update filter person loss image

This commit is contained in:
2022-07-13 15:02:36 +07:00
parent 45c9a9f4f1
commit 4a08ad05df
7 changed files with 75 additions and 24 deletions

View File

@@ -445,13 +445,15 @@ class ListManagementController extends Controller {
foreach ($datas['data'] as $key => $value) {
$filters[$value['id']] = $value['code'] . " - " . $value['name'] . " - " . $value['department'];
}
$deviceDatas = ListManagement::getAllID();
Yii::$app->response->format = "json";
return [
"title" => "<i class='fa fa-download'></i> " . Yii::t("app", "DONG_BO_TU_MAY_CHU"),
"form" => $this->renderPartial("list-server", [
"datas" => $datas['data'],
"filters" => $filters,
"allID" => ListManagement::getAllID()
"personImage" => $deviceDatas["imgCountArr"],
"allID" => $deviceDatas["idArr"]
])
];
}
@@ -555,13 +557,13 @@ class ListManagementController extends Controller {
$model->image = json_encode($ft);
$model->last_modified = time();
$model->save();
// if ($totals <= 10)
// common::updateFeature([
// "cmd" => "update",
// "id" => $model->id,
// "name" => common::convert_vi_to_en($model->name),
// "features" => $model->allFeatures
// ]);
if ($totals <= 10)
common::updateFeature([
"cmd" => "update",
"id" => $model->id,
"name" => common::convert_vi_to_en($model->name),
"features" => $model->allFeatures
]);
} else {
if (isset($data['images'])) {
$extractFeature = $this->extractFeature($data['images'], $data['files_name'], $data['id']);
@@ -587,13 +589,13 @@ class ListManagementController extends Controller {
]);
$finish = $this->getCurrentTime();
$processTime["insertDB"] = round(($finish - $start), 4);
// if ($totals <= 10)
// common::updateFeature([
// "cmd" => "create",
// "id" => $model->id,
// "name" => common::convert_vi_to_en($model->name),
// "features" => $model->allFeatures
// ]);
if ($totals <= 10)
common::updateFeature([
"cmd" => "create",
"id" => $model->id,
"name" => common::convert_vi_to_en($model->name),
"features" => $model->allFeatures
]);
}
$totalFinish = $this->getCurrentTime();
$processTime["total"] = round(($totalFinish - $totalStart), 4);