check exitst images
This commit is contained in:
@@ -308,7 +308,8 @@ class ListManagementController extends Controller {
|
||||
return [
|
||||
"title" => "<i class='fa fa-download'></i> Đồng bộ từ máy chủ",
|
||||
"form" => $this->renderPartial("list-server", [
|
||||
"datas" => $datas['data']
|
||||
"datas" => $datas['data'],
|
||||
"allID" => ListManagement::getAllID()
|
||||
])
|
||||
];
|
||||
}
|
||||
@@ -343,13 +344,16 @@ class ListManagementController extends Controller {
|
||||
foreach ($data['images'] as $key => $value) {
|
||||
$key = common::generateRandomString();
|
||||
$fileName = "face_" . $key . "_" . time() . ".png";
|
||||
file_put_contents($targetPath . "/" . $fileName, file_get_contents($value));
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
$ft[] = ["url" => $fileName, "features" => $features['results'][0]['feature']];
|
||||
$img = file_get_contents($value);
|
||||
if ($img !== "null") {
|
||||
file_put_contents($targetPath . "/" . $fileName, $img);
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
$ft[] = ["url" => $fileName, "features" => $features['results'][0]['feature']];
|
||||
}
|
||||
}
|
||||
$model = ListManagement::findOne(['code' => $data['idStaff']]);
|
||||
if ($model) {
|
||||
|
||||
Reference in New Issue
Block a user