thay đổi tên cửa theo tên thiết bị
This commit is contained in:
parent
e97496a628
commit
579ec676cb
|
@ -125,6 +125,11 @@ class DeviceController extends Controller {
|
|||
$model->area_id = $data["Area"];
|
||||
$model->modified_at = time();
|
||||
if ($model->save()) {
|
||||
$doors = Door::find()->andWhere(["device_id" => $id])->all();
|
||||
foreach ($doors as $key => $value) {
|
||||
$value->name = $data["Name"] . "-" . $value->code;
|
||||
$value->save();
|
||||
}
|
||||
common::insertSystemLogs(["action" => "update", "description" => "Chỉnh sửa thiết bị: " . $data["Name"], "type" => Yii::$app->controller->id]);
|
||||
return ["status" => true];
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue
Block a user