fixbug
This commit is contained in:
parent
aa811a40dd
commit
5472f6ef77
|
@ -236,6 +236,14 @@ class ApiController extends Controller {
|
||||||
public function actionAutoGenFeature() {
|
public function actionAutoGenFeature() {
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||||
|
if (!$updating) {
|
||||||
|
$model = new \app\models\SyncUrl();
|
||||||
|
$model->create([
|
||||||
|
'key_config' => "updating",
|
||||||
|
'data' => "false"
|
||||||
|
]);
|
||||||
|
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||||
|
}
|
||||||
if ($updating->data === "true") {
|
if ($updating->data === "true") {
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
||||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||||
|
|
|
@ -683,7 +683,11 @@ class ListManagementController extends Controller {
|
||||||
$lsImgs = json_decode($StaffInfo->image, true);
|
$lsImgs = json_decode($StaffInfo->image, true);
|
||||||
$images = [];
|
$images = [];
|
||||||
foreach ($lsImgs as $key => $value) {
|
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 = [
|
$items = [
|
||||||
"name" => $StaffInfo->name,
|
"name" => $StaffInfo->name,
|
||||||
|
@ -695,6 +699,7 @@ class ListManagementController extends Controller {
|
||||||
"images" => $images
|
"images" => $images
|
||||||
];
|
];
|
||||||
$start = $this->getCurrentTime();
|
$start = $this->getCurrentTime();
|
||||||
|
try {
|
||||||
$res = json_decode(file_get_contents($ip . "/api/oem/data_sync_pro", false, stream_context_create([
|
$res = json_decode(file_get_contents($ip . "/api/oem/data_sync_pro", false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
|
@ -705,6 +710,9 @@ class ListManagementController extends Controller {
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
])), true);
|
])), true);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
|
}
|
||||||
$finish = $this->getCurrentTime();
|
$finish = $this->getCurrentTime();
|
||||||
$processTime = round(($finish - $start), 4);
|
$processTime = round(($finish - $start), 4);
|
||||||
return $processTime; //$res; //["status" => true];
|
return $processTime; //$res; //["status" => true];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user