]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Выправка fix_change_store_on_opening origin/fix_change_store_on_opening
authormarina <m.zozirova@gmail.com>
Thu, 1 Aug 2024 06:55:54 +0000 (09:55 +0300)
committermarina <m.zozirova@gmail.com>
Thu, 1 Aug 2024 06:55:54 +0000 (09:55 +0300)
erp24/actions/timetable/StartShiftStepTwoAction.php

index aba8215a0ad8cf18b78741d10a26a279759f7ce8..9132305ed230389b604c94ecf6a8e9a8aadd98d1 100755 (executable)
@@ -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();