update control logs

This commit is contained in:
2020-12-04 15:13:14 +07:00
parent 3ef04dfb5a
commit 811ed32e04
13 changed files with 282 additions and 36 deletions

View File

@@ -87,7 +87,9 @@ class ListManagementController extends Controller {
$images[] = ["url" => $url, "features" => $features['results'][0]['feature']];
$listManagement->image = json_encode($images);
$listManagement->time = time();
return $listManagement->save();
$listManagement->save();
file_get_contents("http://localhost:2305/update-feature");
return ["status" => true];
}
} else {
$features = json_decode(common::requestToEngine("/get-feature", [
@@ -98,7 +100,9 @@ class ListManagementController extends Controller {
$data['image'] = json_encode([
["url" => $url, "features" => $features['results'][0]['feature']]
]);
return $model->create($data);
$model->create($data);
file_get_contents("http://localhost:2305/update-feature");
return ["status" => true];
}
}
}
@@ -116,7 +120,7 @@ class ListManagementController extends Controller {
"birthday" => date("d/m/Y", $ListManagement->birthday),
"telephone" => $ListManagement->telephone,
"address" => $ListManagement->address,
"image" => "/BiFace/data/uploads/face/" . $images[0]['url']
"image" => "/data/uploads/face/" . $images[0]['url']
];
}
}
@@ -131,14 +135,18 @@ class ListManagementController extends Controller {
$model->birthday = $data['birthday'] === "" ? 0 : date_format(date_create_from_format('d/m/Y', $data['birthday']), 'U');
$model->telephone = $data['telephone'];
$model->address = $data['address'];
return $model->save();
$model->save();
file_get_contents("http://localhost:2305/update-feature");
return true;
}
}
public function actionDelete() {
if (Yii::$app->request->post()) {
$data = Yii::$app->request->post();
return $this->findModel($data['id'])->delete();
$this->findModel($data['id'])->delete();
file_get_contents("http://localhost:2305/update-feature");
return true;
}
}
@@ -153,7 +161,9 @@ class ListManagementController extends Controller {
$features[] = $value;
}
$model->image = json_encode($features);
return $model->save();
$model->save();
file_get_contents("http://localhost:2305/update-feature");
return true;
}
}
@@ -168,7 +178,9 @@ class ListManagementController extends Controller {
public function actionBatchDelete() {
if (Yii::$app->request->post()) {
$data = Yii::$app->request->post();
return ListManagement::deleteAll(["IN", "id", $data['lists']]);
ListManagement::deleteAll(["IN", "id", $data['lists']]);
file_get_contents("http://localhost:2305/update-feature");
return true;
}
}