From: Marina Zozirova Date: Fri, 2 Aug 2024 10:06:14 +0000 (+0000) Subject: Правка при открытии смены в другом магазине X-Git-Tag: 1.4~49^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b4dbf9355d5abca32e8b3d52d3dca4bd726386bd;p=erp24_rep%2Fyii-erp24%2F.git Правка при открытии смены в другом магазине --- 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();