fix bug empty logs
This commit is contained in:
parent
82a5b0d0ad
commit
e4e080266a
|
@ -75,7 +75,7 @@ class ApiController extends Controller {
|
||||||
$lastLogs->delete();
|
$lastLogs->delete();
|
||||||
}
|
}
|
||||||
$lastLogs = CaptureLogs::find()->andWhere(["staff_id" => $post['id']])->orderBy(["time" => SORT_DESC])->limit(1)->one();
|
$lastLogs = CaptureLogs::find()->andWhere(["staff_id" => $post['id']])->orderBy(["time" => SORT_DESC])->limit(1)->one();
|
||||||
if (($time - $lastLogs->time) < 1) {
|
if ($lastLogs && ($time - $lastLogs->time) < 1) {
|
||||||
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] duplicate face " . $post["id"], FILE_APPEND);
|
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] duplicate face " . $post["id"], FILE_APPEND);
|
||||||
return ["status" => "success"];
|
return ["status" => "success"];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user