]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Вернул условие при котором в adminCheckin попадает plan_id плана администратора
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 19 Jun 2024 12:58:18 +0000 (15:58 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 19 Jun 2024 12:58:18 +0000 (15:58 +0300)
erp24/actions/timetable/StartShiftStepTwoAction.php
erp24/views/timetable/_fact-table.php

index 49b12f1a6b40df6d1327c1512e731763f1920200..85d51a0467d722a842fe40cfb0dbd8ac0a4fc6f6 100755 (executable)
@@ -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')],
index a4d3e6a7fcd1c2af2c637b61e99a46e942c1a062..c03c30ae77daba7be3e52ce8f3ef20b062200d0a 100755 (executable)
@@ -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;
             },
         ],
         [