auto sync list management from server

This commit is contained in:
2021-06-09 13:36:11 +07:00
parent 1e3f0bef13
commit 5598e1f3ad
2 changed files with 141 additions and 87 deletions

View File

@@ -340,6 +340,28 @@ class ConfigController extends Controller {
file_get_contents("http://localhost:2305/update-feature");
} catch (\Exception $exc) {
}
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
$ip = "https://dev-dc.beetai.com";
if ($server_ip)
$ip = $server_ip->data;
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
$id_camera = 209;
if ($device_id)
$id_camera = intval($device_id->data);
try {
file_get_contents($ip . "/api/model/reset_log_model", false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST",
'content' => json_encode([
"idCamera" => $id_camera,
"isCloud" => 0
])
]
]));
} catch (Exception $ex) {
}
}
return Url::to(['/config']);