From b4dbf9355d5abca32e8b3d52d3dca4bd726386bd Mon Sep 17 00:00:00 2001 From: Marina Zozirova Date: Fri, 2 Aug 2024 10:06:14 +0000 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BF?= =?utf8?q?=D1=80=D0=B8=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B8?= =?utf8?q?=20=D1=81=D0=BC=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=B4=D1=80=D1=83?= =?utf8?q?=D0=B3=D0=BE=D0=BC=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD?= =?utf8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/timetable/StartShiftStepTwoAction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index b75180bf..9132305e 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -43,12 +43,12 @@ class StartShiftStepTwoAction extends Action ->all(); $plan = Timetable::find() - ->andWhere(['admin_id' => $userModel->id]) - ->andWhere([ - 'OR', - ['date' => date('Y-m-d')], - ['date' => date('Y-m-d', strtotime('-1 day'))], + ->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(['tabel' => 0]) ->orderBy('id desc') ->one(); -- 2.39.5