update fault_information
This commit is contained in:
parent
8758bb3692
commit
64d9ad0b88
|
@ -514,6 +514,7 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionCheckLogs() {
|
public function actionCheckLogs() {
|
||||||
|
set_time_limit(5000);
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
|
@ -537,6 +538,7 @@ class ApiController extends Controller {
|
||||||
if ($datas['status'] == 10000) {
|
if ($datas['status'] == 10000) {
|
||||||
$logs = $datas['data'];
|
$logs = $datas['data'];
|
||||||
$infomation = [];
|
$infomation = [];
|
||||||
|
$fault_information = [];
|
||||||
foreach ($logs as $key => $value) {
|
foreach ($logs as $key => $value) {
|
||||||
$result = true;
|
$result = true;
|
||||||
if ($value['action'] == "insert_image")
|
if ($value['action'] == "insert_image")
|
||||||
|
@ -557,12 +559,19 @@ class ApiController extends Controller {
|
||||||
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result && in_array($value['action'], ['insert_image', 'remove_image', 'insert_info', 'remove_info', 'reset_all'])) {
|
if (in_array($value['action'], ['insert_image', 'remove_image', 'insert_info', 'remove_info', 'reset_all'])) {
|
||||||
|
if ($result)
|
||||||
$infomation[] = [
|
$infomation[] = [
|
||||||
"obj_Log" => $value['obj_Log'],
|
"obj_Log" => $value['obj_Log'],
|
||||||
"action" => $value['action'],
|
"action" => $value['action'],
|
||||||
"idCamera" => $id_camera
|
"idCamera" => $id_camera
|
||||||
];
|
];
|
||||||
|
else
|
||||||
|
$fault_information[] = [
|
||||||
|
"obj_Log" => $value['obj_Log'],
|
||||||
|
"action" => $value['action'],
|
||||||
|
"idCamera" => $id_camera
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($infomation) > 0)
|
if (count($infomation) > 0)
|
||||||
|
@ -571,7 +580,8 @@ class ApiController extends Controller {
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
'method' => "POST",
|
'method' => "POST",
|
||||||
'content' => json_encode([
|
'content' => json_encode([
|
||||||
"infomation" => $infomation
|
"infomation" => $infomation,
|
||||||
|
"fault_information" => $fault_information
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
]));
|
]));
|
||||||
|
@ -642,7 +652,7 @@ class ApiController extends Controller {
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
$ft = [];
|
$ft = [];
|
||||||
foreach ($images as $key => $value) {
|
foreach ($images as $key => $value) {
|
||||||
if ($value['serverKey'] !== $files_name)
|
if (isset($value['serverKey']) && $value['serverKey'] !== $files_name)
|
||||||
$ft[] = $value;
|
$ft[] = $value;
|
||||||
else
|
else
|
||||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user