From fc347376d39a2ab637b226ee2b7a0be3b838e976 Mon Sep 17 00:00:00 2001 From: dongpd Date: Tue, 15 Dec 2020 10:55:54 +0700 Subject: [PATCH] update sync server --- controllers/ApiController.php | 2 +- controllers/ListManagementController.php | 7 +++---- db/app.db | Bin 2404352 -> 2404352 bytes models/ListManagement.php | 8 ++++---- views/capture-logs/index.tpl | 4 ++-- views/config/config.tpl | 2 +- views/config/device.tpl | 2 +- views/config/index.tpl | 2 +- views/list-management/index.tpl | 4 ++-- views/list-management/list-server.tpl | 2 -- web/js/list-management.js | 1 - 11 files changed, 15 insertions(+), 19 deletions(-) diff --git a/controllers/ApiController.php b/controllers/ApiController.php index af5cceb6..35030d53 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -89,7 +89,7 @@ class ApiController extends Controller { } $allFeatures[] = [ "id" => $value->id, - "name" => $value->name, + "name" => $value->code, "features" => $f ]; } diff --git a/controllers/ListManagementController.php b/controllers/ListManagementController.php index c6bc8eb7..9c440618 100644 --- a/controllers/ListManagementController.php +++ b/controllers/ListManagementController.php @@ -336,19 +336,18 @@ class ListManagementController extends Controller { ]), true); $ft[] = ["url" => $fileName, "features" => $features['results'][0]['feature']]; } - $model = ListManagement::findOne(['code' => $data['idStaff']]); if ($model) { - $model->name = $data['code']; + $model->name = $data['name']; $model->image = json_encode($ft); $model->last_modified = time(); $model->save(); } else { $model = new ListManagement(); $model->create([ - 'code' => $data['idStaff'], + 'code' => strval($data['idStaff']), 'type' => "wl", - 'name' => $data['code'], + 'name' => $data['name'], 'image' => json_encode($ft), 'gender' => "", 'birthday' => "", diff --git a/db/app.db b/db/app.db index b1205d58edae079d355e093e980b3f97e5ed3bb0..562c876d043a3741a8e81a31f84c268eab63f877 100644 GIT binary patch delta 423 zcmX}kze@sf7zXfrz4JUP{dVc4rD?yWE;_~h5fV1J#;4g7X{D0~<@=F935J3Vf$Y28n>@Wa>Fa!>8_VP>Y r?3GyK%R3AzjDQQ=pus43zzbtA4nFY11Oy-mlQ0F-Fw^_;&JOcm`ow|g delta 428 zcmZY1zb^xE7zXg~dw0ESOZ)B7qiC;wEmCrq%9RpCFd5phTUB(Bvzrf0DvY0HMSmn(p&+@!a{o{h_a5khbGA6AvMiO!!DW6YH)8hTcbu!xY z@hASqoBWmE@K64XYdq-r9QU@Zl+rURr@TumHxLi(MdxJ8zqec2EV||DPSGuGR?5Zn zf!(sn3~RT(w)&`C$%bsOBTvse=g(%RX4ALq)s=~$xtacYy%oBlTx5giOs zTGTR>5+gHoBH9kMB>%fu%23t6rv3d-i^mN8C{1AX3bU`tc5{6*}Mq#Y;6&sI;Ur@A!8~^|S diff --git a/models/ListManagement.php b/models/ListManagement.php index 8013b889..7d1984d2 100644 --- a/models/ListManagement.php +++ b/models/ListManagement.php @@ -8,7 +8,7 @@ use Yii; * This is the model class for table "list_management". * * @property int $id - * @property int $code + * @property string $code * @property string $type * @property string $name * @property string $image @@ -33,8 +33,8 @@ class ListManagement extends \yii\db\ActiveRecord { */ public function rules() { return [ - [['type', 'name', 'gender', 'telephone', 'address', 'image'], 'string'], - [['birthday', 'time', 'code', 'last_modified'], 'integer'], + [['type', 'name', 'gender', 'telephone', 'address', 'image', 'code'], 'string'], + [['birthday', 'time', 'last_modified'], 'integer'], ]; } @@ -44,7 +44,7 @@ class ListManagement extends \yii\db\ActiveRecord { public function attributeLabels() { return [ 'id' => 'ID', - 'code' => 'Code', + 'code' => 'ID', 'type' => 'Type', 'name' => 'Name', 'image' => 'Registration Image', diff --git a/views/capture-logs/index.tpl b/views/capture-logs/index.tpl index 46e3f6b3..b71eb6a5 100644 --- a/views/capture-logs/index.tpl +++ b/views/capture-logs/index.tpl @@ -97,9 +97,9 @@
-
Code
+
ID
- +
diff --git a/views/config/config.tpl b/views/config/config.tpl index 46b80774..ac5f66ce 100644 --- a/views/config/config.tpl +++ b/views/config/config.tpl @@ -160,7 +160,7 @@
Server config
-
2
+
3
Cấu hình nhận diện
diff --git a/views/config/device.tpl b/views/config/device.tpl index 20d7845e..3e19ac95 100644 --- a/views/config/device.tpl +++ b/views/config/device.tpl @@ -34,7 +34,7 @@
Server config
-
2
+
3
Cấu hình nhận diện
diff --git a/views/config/index.tpl b/views/config/index.tpl index f5f7240a..1418a319 100644 --- a/views/config/index.tpl +++ b/views/config/index.tpl @@ -34,7 +34,7 @@
Server config
-
2
+
3
Cấu hình nhận diện
diff --git a/views/list-management/index.tpl b/views/list-management/index.tpl index 441ab82a..e0f13847 100644 --- a/views/list-management/index.tpl +++ b/views/list-management/index.tpl @@ -203,9 +203,9 @@
-
Code
+
ID
- +
diff --git a/views/list-management/list-server.tpl b/views/list-management/list-server.tpl index ffedef38..e5c38af1 100644 --- a/views/list-management/list-server.tpl +++ b/views/list-management/list-server.tpl @@ -4,7 +4,6 @@ ID Name - Code Department Registration Image Code @@ -16,7 +15,6 @@ {$arr.idStaff} {$arr.name} - {$arr.code} {$arr.department} {foreach from=$arr.images item=img} diff --git a/web/js/list-management.js b/web/js/list-management.js index a0e1868a..d1741478 100644 --- a/web/js/list-management.js +++ b/web/js/list-management.js @@ -440,7 +440,6 @@ function syncFeature(id) { } function updateFeature() { - console.log("abc"); $.ajax({ url: $("input[name='update_feature_url']").val(), type: 'POST',