update: lấy dữ liệu mã thẻ từ thiết bị, mở cửa từ phần mềm

This commit is contained in:
2020-10-26 14:25:49 +07:00
parent 579ec676cb
commit 2b88dbb695
7 changed files with 138 additions and 7 deletions

View File

@@ -541,4 +541,15 @@ class DeviceController extends Controller {
}
}
public function actionOpenDoor($id, $door) {
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = "json";
$model = $this->findModel($id);
return json_decode(common::requestToCardService("/ControlDevice", [
"DeviceIP" => $model->ip_address,
"DoorID" => $door
]), true);
}
}
}