filter dong bo du lieu giua cac thiet bi

This commit is contained in:
2020-12-30 11:43:03 +07:00
parent d296533184
commit 09604d1cb8
4 changed files with 107 additions and 8 deletions

View File

@@ -114,7 +114,7 @@ class ListManagementController extends Controller {
return ["status" => false, "text" => "Mỗi đối tượng chỉ nhận tối đa " . \Yii::$app->params['maxPicture'] . " hình ảnh mẫu"];
$add = true;
foreach ($images as $key => $value) {
if ($value['urlOld'] === $url)
if (isset($value['urlOld']) && $value['urlOld'] === $url)
$add = false;
}
if ($add) {
@@ -368,12 +368,17 @@ class ListManagementController extends Controller {
'content' => json_encode(ListManagement::nameArray())
]
])), true);
$filters = [];
foreach ($results as $key => $value) {
$filters[$value['code']] = $value['code'] . " - " . $value['name'] . " - " . $value['address'];
}
Yii::$app->response->format = "json";
return [
"title" => $data['ip'],
"form" => $this->renderPartial("list", [
"results" => $results,
"typeArray" => ListManagement::$typeArray,
"filters" => $filters,
"ip" => $data['ip']
])
];
@@ -477,7 +482,8 @@ class ListManagementController extends Controller {
$features = json_decode(common::requestToEngine("/get-feature", [
"image_paths" => [
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
]
],
"type" => "128"
]), true);
$finish = $this->getCurrentTime();
$temp["extract"] = round(($finish - $start), 4);
@@ -575,7 +581,7 @@ class ListManagementController extends Controller {
$model->name = $value['name'];
$model->image = json_encode($images);
$model->gender = $value['gender'];
$model->birthday = date("d/m/Y", $value['birthday']);
$model->birthday = $value['birthday'];
$model->telephone = $value['telephone'];
$model->address = $value['department'];
$model->save();