From: marina Date: Thu, 1 Aug 2024 06:55:54 +0000 (+0300) Subject: Выправка X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=445f4c9b1a0999eee994470f310946fc77b8a46f;p=erp24_rep%2Fyii-erp24%2F.git Выправка --- 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();