diff --git a/controllers/ApiController.php b/controllers/ApiController.php index 35030d53..2c551a86 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -123,13 +123,39 @@ class ApiController extends Controller { "gender" => $value->gender, "birthday" => $value->birthday, "telephone" => $value->telephone, - "address" => $value->address, + "department" => $value->address, "time" => $value->time, - "image" => $f + "images" => $f ]; } return $res; } } + public function actionGetAllImage() { + Yii::$app->response->format = "json"; + $lists = ListManagement::find()->orderBy(['id' => SORT_DESC])->all(); + $res = []; + foreach ($lists as $key => $value) { + $f = []; + $features = json_decode($value->image, true); + foreach ($features as $k => $v) { + $f[] = Yii::$app->request->hostInfo . "/data/uploads/face/" . $v['url']; + } + $res[] = [ + "id" => $value->id, + "code" => $value->code, + "type" => $value->type, + "name" => $value->name, + "gender" => $value->gender, + "birthday" => $value->birthday, + "telephone" => $value->telephone, + "address" => $value->address, + "time" => $value->time, + "image" => $f + ]; + } + return $res; + } + } diff --git a/controllers/ListManagementController.php b/controllers/ListManagementController.php index 9c440618..ed7da178 100644 --- a/controllers/ListManagementController.php +++ b/controllers/ListManagementController.php @@ -339,6 +339,7 @@ class ListManagementController extends Controller { $model = ListManagement::findOne(['code' => $data['idStaff']]); if ($model) { $model->name = $data['name']; + $model->address = $data['department']; $model->image = json_encode($ft); $model->last_modified = time(); $model->save(); @@ -352,7 +353,7 @@ class ListManagementController extends Controller { 'gender' => "", 'birthday' => "", 'telephone' => "", - 'address' => "" + 'address' => $data['department'] ]); } return ["status" => true]; diff --git a/models/ListManagement.php b/models/ListManagement.php index 7d1984d2..7d676909 100644 --- a/models/ListManagement.php +++ b/models/ListManagement.php @@ -51,7 +51,7 @@ class ListManagement extends \yii\db\ActiveRecord { 'gender' => 'Gender', 'birthday' => 'Birthday', 'telephone' => 'Telephone', - 'address' => 'Address', + 'address' => 'Department', 'time' => 'Registration time', 'last_modified' => 'Last Modified' ]; diff --git a/views/capture-logs/index.tpl b/views/capture-logs/index.tpl index b71eb6a5..a2cdec3e 100644 --- a/views/capture-logs/index.tpl +++ b/views/capture-logs/index.tpl @@ -130,7 +130,7 @@
-
Address
+
Department
diff --git a/views/list-management/index.tpl b/views/list-management/index.tpl index e0f13847..b429d085 100644 --- a/views/list-management/index.tpl +++ b/views/list-management/index.tpl @@ -235,7 +235,7 @@
-
Address
+
Department
diff --git a/views/list-management/list.tpl b/views/list-management/list.tpl index 4a7ddc5f..28025dd2 100644 --- a/views/list-management/list.tpl +++ b/views/list-management/list.tpl @@ -10,7 +10,7 @@ Registration time Birthday Telephone - Address + Department