auto sync data, remove crontab

This commit is contained in:
2020-12-22 14:57:13 +07:00
parent bba20c9c17
commit 3f289ddc9d
11 changed files with 122 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ class CaptureLogsController extends Controller {
];
}
public function actionIndex($from = "", $to = "") {
public function actionIndex($from = "", $to = "", $all = false) {
$f = date_format(date_create_from_format('H:i d/m/Y', "00:00 " . date("d/m/Y")), 'U');
$t = date_format(date_create_from_format('H:i d/m/Y', "23:59 " . date("d/m/Y")), 'U');
if ($from !== "" && $to !== "") {
@@ -40,9 +40,9 @@ class CaptureLogsController extends Controller {
$this->view->title = "Capture Log";
$searchModel = new CaptureLogsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->query->andWhere(["capture_logs.staff_id" => 0]);
if (!$all)
$dataProvider->query->andWhere(["capture_logs.staff_id" => 0]);
$dataProvider->query->andWhere(["BETWEEN", "capture_logs.time", $f, $t]);
$dataProvider->query->orderBy(["time" => SORT_DESC]);
// $tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
// 'http' => [