update dổi tên cửa realtime
This commit is contained in:
@@ -640,7 +640,17 @@ class DeviceController extends Controller {
|
||||
$model->modified_at = time();
|
||||
$model->save();
|
||||
}
|
||||
return $id;
|
||||
$doors = Door::find()->andWhere(["device_id" => $model->device_id])->all();
|
||||
$ls = [];
|
||||
foreach ($doors as $key => $value) {
|
||||
$ls[] = $value->name;
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"id" => $id,
|
||||
"device_id" => $model->device_id,
|
||||
"form" => implode("<br>", $ls)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user