update sync server

This commit is contained in:
dongpd 2020-12-15 14:47:02 +07:00
parent fc347376d3
commit 9bdfb205f6
6 changed files with 34 additions and 7 deletions

View File

@ -123,13 +123,39 @@ class ApiController extends Controller {
"gender" => $value->gender, "gender" => $value->gender,
"birthday" => $value->birthday, "birthday" => $value->birthday,
"telephone" => $value->telephone, "telephone" => $value->telephone,
"address" => $value->address, "department" => $value->address,
"time" => $value->time, "time" => $value->time,
"image" => $f "images" => $f
]; ];
} }
return $res; 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;
}
} }

View File

@ -339,6 +339,7 @@ class ListManagementController extends Controller {
$model = ListManagement::findOne(['code' => $data['idStaff']]); $model = ListManagement::findOne(['code' => $data['idStaff']]);
if ($model) { if ($model) {
$model->name = $data['name']; $model->name = $data['name'];
$model->address = $data['department'];
$model->image = json_encode($ft); $model->image = json_encode($ft);
$model->last_modified = time(); $model->last_modified = time();
$model->save(); $model->save();
@ -352,7 +353,7 @@ class ListManagementController extends Controller {
'gender' => "", 'gender' => "",
'birthday' => "", 'birthday' => "",
'telephone' => "", 'telephone' => "",
'address' => "" 'address' => $data['department']
]); ]);
} }
return ["status" => true]; return ["status" => true];

View File

@ -51,7 +51,7 @@ class ListManagement extends \yii\db\ActiveRecord {
'gender' => 'Gender', 'gender' => 'Gender',
'birthday' => 'Birthday', 'birthday' => 'Birthday',
'telephone' => 'Telephone', 'telephone' => 'Telephone',
'address' => 'Address', 'address' => 'Department',
'time' => 'Registration time', 'time' => 'Registration time',
'last_modified' => 'Last Modified' 'last_modified' => 'Last Modified'
]; ];

View File

@ -130,7 +130,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4 text-right">Address</div> <div class="col-md-4 text-right">Department</div>
<div class="col-md-8"> <div class="col-md-8">
<input type="text" name="Address"> <input type="text" name="Address">
</div> </div>

View File

@ -235,7 +235,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4 text-right">Address</div> <div class="col-md-4 text-right">Department</div>
<div class="col-md-8"> <div class="col-md-8">
<input type="text" name="Address"> <input type="text" name="Address">
</div> </div>

View File

@ -10,7 +10,7 @@
<th>Registration time</th> <th>Registration time</th>
<th>Birthday</th> <th>Birthday</th>
<th>Telephone</th> <th>Telephone</th>
<th>Address</th> <th>Department</th>
</tr> </tr>
</thead> </thead>
<tbody id="sync-lists"> <tbody id="sync-lists">