điều chỉnh cơ chế ghi đè thông tin khi trùng idStaff
This commit is contained in:
parent
7ff0f1b976
commit
fbc48fca53
|
@ -359,6 +359,13 @@ class ListManagementController extends Controller {
|
|||
$ft[] = ["url" => $fileName, "features" => $features['results'][0]['feature']];
|
||||
}
|
||||
|
||||
$model = ListManagement::findOne(['code' => $data['idStaff']]);
|
||||
if ($model) {
|
||||
$model->name = $data['name'];
|
||||
$model->image = json_encode($ft);
|
||||
$model->last_modified = time();
|
||||
$model->save();
|
||||
} else {
|
||||
$model = new ListManagement();
|
||||
$model->create([
|
||||
'code' => $data['idStaff'],
|
||||
|
@ -370,7 +377,7 @@ class ListManagementController extends Controller {
|
|||
'telephone' => "",
|
||||
'address' => ""
|
||||
]);
|
||||
// file_get_contents("http://localhost:2305/update-feature");
|
||||
}
|
||||
return ["status" => true];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user