From: Alexander Smirnov Date: Wed, 19 Jun 2024 12:58:18 +0000 (+0300) Subject: Вернул условие при котором в adminCheckin попадает plan_id плана администратора X-Git-Tag: 1.3~52^2~7 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=6db5eaa85bbe9b41aa351e61d4696b4e6ab01f4b;p=erp24_rep%2Fyii-erp24%2F.git Вернул условие при котором в adminCheckin попадает plan_id плана администратора --- diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index 49b12f1a..85d51a04 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -79,7 +79,11 @@ class StartShiftStepTwoAction extends Action /** @var TimetablePlan[] $planSlots */ $planSlots = TimetablePlan::find() - ->andFilterWhere(['store_id' => $model->store_id]) + ->andWhere( + ($device->isFixedStore() && !$userModel->adminGroup->isRoaming()) ? + ['store_id' => $model->store_id] : + ['admin_id' => $model->admin_id] + ) ->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')], diff --git a/erp24/views/timetable/_fact-table.php b/erp24/views/timetable/_fact-table.php index a4d3e6a7..c03c30ae 100755 --- a/erp24/views/timetable/_fact-table.php +++ b/erp24/views/timetable/_fact-table.php @@ -42,7 +42,7 @@ $now = new \DateTime(); [ 'label' => 'сотрудник', 'content' => function (TimetablePlan $slot) { - return \yii_app\helpers\HtmlHelper::userPrint($slot->admin); + return $slot->admin ? \yii_app\helpers\HtmlHelper::userPrint($slot->admin) : '#' . $slot->admin_id; }, ], [