This commit is contained in:
2021-01-13 18:11:51 +07:00
parent aa811a40dd
commit 5472f6ef77
2 changed files with 27 additions and 11 deletions

View File

@@ -683,7 +683,11 @@ class ListManagementController extends Controller {
$lsImgs = json_decode($StaffInfo->image, true);
$images = [];
foreach ($lsImgs as $key => $value) {
$images[] = base64_encode(file_get_contents(Yii::$app->request->hostInfo . "/data/uploads/face/" . $value['url']));
try {
$images[] = base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']));
} catch (\Exception $e) {
}
}
$items = [
"name" => $StaffInfo->name,
@@ -695,16 +699,20 @@ class ListManagementController extends Controller {
"images" => $images
];
$start = $this->getCurrentTime();
$res = json_decode(file_get_contents($ip . "/api/oem/data_sync_pro", false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST",
'content' => json_encode([
"id_camera" => $id_camera,
"items" => [$items]
])
]
])), true);
try {
$res = json_decode(file_get_contents($ip . "/api/oem/data_sync_pro", false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST",
'content' => json_encode([
"id_camera" => $id_camera,
"items" => [$items]
])
]
])), true);
} catch (\Exception $e) {
}
$finish = $this->getCurrentTime();
$processTime = round(($finish - $start), 4);
return $processTime; //$res; //["status" => true];