From 445f4c9b1a0999eee994470f310946fc77b8a46f Mon Sep 17 00:00:00 2001 From: marina Date: Thu, 1 Aug 2024 09:55:54 +0300 Subject: [PATCH] =?utf8?q?=D0=92=D1=8B=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/timetable/StartShiftStepTwoAction.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index aba8215a..9132305e 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -43,8 +43,12 @@ class StartShiftStepTwoAction extends Action ->all(); $plan = Timetable::find() + ->andWhere(['OR', + ['BETWEEN', 'datetime_start', date('Y-m-d H:i:s'), date('Y-m-d H:i:s', strtotime('+6 hour'))], + ['BETWEEN', 'datetime_end', date('Y-m-d H:i:s', strtotime('-6 hour')), date('Y-m-d H:i:s')], + ['AND', ['<', 'datetime_start', date('Y-m-d H:i:s')], ['>', 'datetime_end', date('Y-m-d H:i:s')]] + ]) ->andWhere(['admin_id' => $userModel->id]) - ->andWhere(['date' => date('Y-m-d')]) ->andWhere(['tabel' => 0]) ->orderBy('id desc') ->one(); -- 2.39.5