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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user