fix send logs realtime

This commit is contained in:
2021-06-04 11:24:03 +07:00
parent 08266f3a5f
commit 821cf9463d
3 changed files with 33 additions and 14 deletions

View File

@@ -84,7 +84,7 @@ class ApiController extends Controller {
$ip = "https://dev-dc.beetai.com";
if ($server_ip)
$ip = $server_ip->data;
if ($this->is_connected($ip) && $logs) {
if ($this->is_connected() && $logs) {
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
$id_camera = 209;
if ($device_id)
@@ -104,6 +104,7 @@ class ApiController extends Controller {
'camera_id' => strval($id_camera),
'frametime' => date("Y-m-d H:i:s", $time),
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
"person_id" => "123",
"timezone" => "+7"
])
@@ -353,6 +354,7 @@ class ApiController extends Controller {
'camera_id' => strval($id_camera),
'frametime' => date("Y-m-d H:i:s", $value->time),
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
"person_id" => "123",
"timezone" => "+7"
])
@@ -489,9 +491,9 @@ class ApiController extends Controller {
if ($this->check512()) {
$currentCache = json_decode(file_get_contents("http://localhost:2305/current-cache"), true);
if ($currentCache['n_128'] == $currentCache['n_512']) {
$updating->data = "true";
$updating->data = "true";
} else {
$updating->data = "false";
$updating->data = "false";
}
} else
$updating->data = "false";