update điều chỉnh thời gian mở cửa
This commit is contained in:
@@ -579,11 +579,21 @@ class DeviceController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function actionEditDoorName($id) {
|
||||
public function actionEditDoor($id) {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$model = Door::findOne($id);
|
||||
if ($model) {
|
||||
$model->name = Yii::$app->request->post("name");
|
||||
$model->name = $post["name"];
|
||||
if ($model->duration !== $post["duration"]) {
|
||||
$device = $this->findModel($model->device_id);
|
||||
common::requestToCardService("/SetDeviceData/DoorDriverTime", [
|
||||
"DeviceIP" => $device->ip_address,
|
||||
"DoorID" => $model->code,
|
||||
"DoorDriverTime" => $post["duration"]
|
||||
]);
|
||||
$model->duration = $post["duration"];
|
||||
}
|
||||
$model->modified_at = time();
|
||||
$model->save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user