]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
переименование date_shift TimetableFactModel.php в date
authormarina <m.zozirova@gmail.com>
Wed, 18 Sep 2024 13:01:15 +0000 (16:01 +0300)
committermarina <m.zozirova@gmail.com>
Wed, 18 Sep 2024 13:01:15 +0000 (16:01 +0300)
19 files changed:
erp24/actions/motivation/GetSalaryAction.php
erp24/actions/timetable/AddFactHandAction.php
erp24/actions/timetable/EditPlanAction.php
erp24/actions/timetable/StartShiftStepTwoAction.php
erp24/api3/core/services/TimetableService.php
erp24/api3/modules/v1/models/Admin.php
erp24/commands/TimetableController.php
erp24/controllers/TimetableFactController.php
erp24/migrations/m240918_124420_change_table_name_timetable_fact.php [new file with mode: 0644]
erp24/records/TimetableFactModel.php
erp24/services/CabinetService.php
erp24/services/MotivationService.php
erp24/views/motivation/records.php
erp24/views/timetable-fact/index.php
erp24/views/timetable-fact/merge-shifts.php
erp24/views/timetable-fact/view.php
erp24/views/timetable/add-fact-hand.php
erp24/views/timetable/plan.php
erp24/views/timetable/tabel_edit.php

index 0c2e327b20a9cb87e8b8a3bf1b43516e5ea0b4a7..28e2441ca62a46dc82d844a6a3b6585061a50d1c 100644 (file)
@@ -70,7 +70,7 @@ class GetSalaryAction extends Action
                     'admin_name' => $adminName,
                     'salary_shift' => $record->salary_shift,
                     'daily_payment' => $dailyPayment,
-                    'date_shift' => $record->date_shift
+                    'date' => $record->date
                 ];
             }
 
index a6e5ec475a17cb5b419b7897b22b69c0cd218476..2278629a11335a5c8e8e6126374a05c8218d5aa4 100644 (file)
@@ -76,8 +76,8 @@ class AddFactHandAction extends Action
                         $timetableFactModel->store_id = $model->store_id;
                         $timetableFactModel->admin_group_id = $model->admin_group_id;
                         $timetableFactModel->d_id = $model->admin_group_id;
-                        $timetableFactModel->date_shift = date('Y-m-d', strtotime($model->shift_start));
-                        $timetableFactModel->date_start = $timetableFactModel->date_shift;
+                        $timetableFactModel->date = date('Y-m-d', strtotime($model->shift_start));
+                        $timetableFactModel->date_start = $timetableFactModel->date;
                         if ($action == 'createFact') {
                             $timetableFactModel->date_end = date('Y-m-d', strtotime($model->shift_end));
                             $timetableFactModel->is_opening = false;
@@ -178,8 +178,8 @@ class AddFactHandAction extends Action
                 ])->all();
 
             $timetableFacts = TimetableFactModel::find()->where(['admin_id' => $model->admin_id])
-                ->andWhere(['>=', 'date_shift', date('Y-m-d', strtotime($model->shift_start))])
-                ->andWhere(['<=', 'date_shift', date('Y-m-d', strtotime($model->shift_end))])
+                ->andWhere(['>=', 'date', date('Y-m-d', strtotime($model->shift_start))])
+                ->andWhere(['<=', 'date', date('Y-m-d', strtotime($model->shift_end))])
                 ->all();
         }
 
index 5208d51790bcd8891f02d9b4f2761a6c79cd5be1..a6db96566074c468bebf69adeaf56d5e7eb144bd 100755 (executable)
@@ -65,7 +65,7 @@ class EditPlanAction extends Action
             $slot->time_end = $slot->shift ? $slot->shift->end_time : null;
         }
         $fact = TimetableFact::find()->andWhere(['plan_id' => $slot->id])->one();
-        $dataProvider = new ActiveDataProvider(['query' => TimetableFactModel::find()->where(['admin_id' => $row['admin_id'], 'date_shift' => $row['date']])]);
+        $dataProvider = new ActiveDataProvider(['query' => TimetableFactModel::find()->where(['admin_id' => $row['admin_id'], 'date' => $row['date']])]);
         return $this->controller->renderPartial('/timetable/tabel_edit.php', [
             'slot' => $slot,
             'fact' => $fact,
index 9132305ed230389b604c94ecf6a8e9a8aadd98d1..06e35690207884392cd23f0ba6fb51e4a53d0a98 100755 (executable)
@@ -111,7 +111,7 @@ class StartShiftStepTwoAction extends Action
         if ($fact) {
             $model->plan_id = $fact->plan_id;
             $model->replaced_admin_id = $fact->admin_id_add;
-            $model->date = $fact->date_shift;
+            $model->date = $fact->date;
             $model->d_id = $fact->d_id;
         } else {
             if ($device->isFixedStore()) {
index a4a04520f90131045e65421632d008c80390b778..93b70a2b0461d084aef665ed45adf6324a25c88b 100644 (file)
@@ -152,7 +152,7 @@ class TimetableService
         $checkIn->plan_id = $fact->plan_id;
         $checkIn->store_id = $fact->store_id;
         $checkIn->d_id = $fact->admin->group_id;
-        $checkIn->date = $fact->date_shift;
+        $checkIn->date = $fact->date;
         $checkIn->ball = 5;
         $checkIn->comment = "";
         $checkIn->admin_id = $admin_id;
index 9260af70bfe58bf3663b61df7de122d3c8f7fbb6..ed684f50585593c5524e45188d7b34315d9cafdb 100644 (file)
@@ -120,7 +120,7 @@ class Admin extends \yii_app\records\Admin
             ->andWhere(['is_opening' => true])
             ->addSelect([
                 'id as id',
-                'date_shift as date',
+                'date as date',
                 'date_start as start',
                 'date_end as end',
             ])
index e3ce4e3b7891da79163f83009e4341f00ac0d0c6..050f999d55e29159027f670d49744745174fa386 100644 (file)
@@ -26,7 +26,7 @@ class TimetableController extends Controller
             $checkIn->ball = 5;
             $checkIn->comment = "Закрыта автоматически " . date('d-m-Y H-i-s');
             $checkIn->d_id = $timetableFactModel->d_id;
-            $checkIn->date = $timetableFactModel->date_shift;
+            $checkIn->date = $timetableFactModel->date;
             $checkIn->time = date('Y-m-d H:i:s', strtotime('+14 hours', strtotime($timetableFactModel->date_start . ' ' . $timetableFactModel->time_start)));
             $checkIn->lat = 0;
             $checkIn->lon = 0;
index 133edfb3d514bb1bbf48bce29feecb47d3b61998..70184d3b425c50d16dfd5a25b29c1ac2c26a4609 100644 (file)
@@ -63,10 +63,10 @@ class TimetableFactController extends Controller
             $timetableFactModelQuery->andWhere(['store_id' => $model->store_id]);
         }
         if ($model->date_start) {
-            $timetableFactModelQuery->andWhere(['>=', 'date_shift', date('Y-m-d 00:00:00', strtotime($model->date_start))]);
+            $timetableFactModelQuery->andWhere(['>=', 'date', date('Y-m-d 00:00:00', strtotime($model->date_start))]);
         }
         if ($model->date_end) {
-            $timetableFactModelQuery->andWhere(['<=', 'date_shift', date('Y-m-d 23:59:59', strtotime($model->date_end))]);
+            $timetableFactModelQuery->andWhere(['<=', 'date', date('Y-m-d 23:59:59', strtotime($model->date_end))]);
         }
         if ($model->group_id && $model->group_id > 0) {
             $timetableFactModelQuery->andWhere(['d_id' => $model->group_id]);
@@ -78,7 +78,7 @@ class TimetableFactController extends Controller
             $timetableFactModelQuery->andWhere(['autoclosed' => '1']);
         }
         if (!$model->sort) {
-            $timetableFactModelQuery->orderBy(['date_shift' => SORT_DESC]);
+            $timetableFactModelQuery->orderBy(['date' => SORT_DESC]);
         }
 
         $storeArr = CityStore::find()->all();
@@ -228,7 +228,7 @@ class TimetableFactController extends Controller
 
             foreach ($timetables as $timetable) {
                 $newFact = TimetableFactModel::find()
-                    ->andWhere(['date_shift' => $timetable->date])
+                    ->andWhere(['date' => $timetable->date])
                     ->andWhere(['admin_id' => $timetable->admin_id])
                     ->andWhere(['store_id' => $timetable->store_id])
                     ->one();
@@ -306,7 +306,7 @@ class TimetableFactController extends Controller
 
             foreach ($plans as $plan) {
                 $facts = TimetableFactModel::find()
-                    ->andWhere(['date_shift' => $plan->date])
+                    ->andWhere(['date' => $plan->date])
                     ->andWhere(['admin_id' => $plan->admin_id])
                     ->andWhere(['store_id' => $plan->store_id])
                     ->orderBy('id asc')
@@ -345,7 +345,7 @@ class TimetableFactController extends Controller
                     ->andWhere(['admin_id' => $fact->admin_id])
                     ->andWhere(['store_id' => $fact->store_id])
                     ->andWhere(['!=', 'id', $fact->id])
-                    ->andWhere(['date_shift' => $fact->date_shift])
+                    ->andWhere(['date' => $fact->date])
                     ->andWhere(['shift_id' => $fact->shift_id])
                     ->one();
 
@@ -370,9 +370,9 @@ class TimetableFactController extends Controller
 
         $dataProvider = new ActiveDataProvider([
             'query' => TimetableFactModel::find()
-                ->andWhere(['>=', 'date_shift', '2024-07-01'])
-                ->andWhere(['<=', 'date_shift', date('Y-m-d')])
-                ->orderBy('date_shift, admin_id,id,  store_id'),
+                ->andWhere(['>=', 'date', '2024-07-01'])
+                ->andWhere(['<=', 'date', date('Y-m-d')])
+                ->orderBy('date, admin_id,id,  store_id'),
             'pagination' => [
                 'pageSize' => false
             ]
@@ -416,7 +416,7 @@ class TimetableFactController extends Controller
                     }
 
                     $fact = TimetableFactModel::find()
-                        ->andWhere(['date_shift' => $plan->date])
+                        ->andWhere(['date' => $plan->date])
                         ->andWhere(['admin_id' => $plan->admin_id])
                         ->andWhere(['store_id' => $plan->store_id])
                         ->one();
@@ -438,9 +438,9 @@ class TimetableFactController extends Controller
 
         $dataProvider = new ActiveDataProvider([
             'query' => TimetableFactModel::find()
-                ->andWhere(['>=', 'date_shift', '2024-07-01'])
-                ->andWhere(['<=', 'date_shift', date('Y-m-d')])
-                ->orderBy('date_shift, admin_id,id,  store_id'),
+                ->andWhere(['>=', 'date', '2024-07-01'])
+                ->andWhere(['<=', 'date', date('Y-m-d')])
+                ->orderBy('date, admin_id,id,  store_id'),
             'pagination' => [
                 'pageSize' => false
             ]
diff --git a/erp24/migrations/m240918_124420_change_table_name_timetable_fact.php b/erp24/migrations/m240918_124420_change_table_name_timetable_fact.php
new file mode 100644 (file)
index 0000000..57f538d
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m240918_124420_change_table_name_timetable_fact
+ */
+class m240918_124420_change_table_name_timetable_fact extends Migration
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->renameColumn('timetable_fact', 'date_shift', 'date');
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->renameColumn('timetable_fact', 'date', 'date_shift');
+    }
+
+    /*
+    // Use up()/down() to run migration code without a transaction.
+    public function up()
+    {
+
+    }
+
+    public function down()
+    {
+        echo "m240918_124420_change_table_name_timetable_fact cannot be reverted.\n";
+
+        return false;
+    }
+    */
+}
index 6c0c56bd300c36e0ef89b1f2bc8a25aade5b618c..33af9f50dea488373859f3a53eab7bab19718d7c 100644 (file)
@@ -21,7 +21,7 @@ use yii_app\records\Shift;
  * @property int $store_id ID магазина
  * @property int $admin_group_id ID должности
  * @property int $d_id в какой должности работал на смене
- * @property $date_shift дата смены
+ * @property $date дата смены
  * @property $date_start дата время открытия смены
  * @property $date_end дата время закрытия смены
  * @property bool $is_opening на открытие смены
@@ -61,7 +61,7 @@ class TimetableFactModel extends ActiveRecord
             'store_id' => 'Магазин',
             'admin_group_id' => 'Должность',
             'd_id' => 'в какой должности работал на смене',
-            'date_shift' => 'дата смены',
+            'date' => 'дата смены',
             'date_start' => 'дата открытия смены',
             'date_end' => 'дата закрытия смены',
             'is_opening' => 'смена открыта?',
@@ -97,7 +97,7 @@ class TimetableFactModel extends ActiveRecord
             [['comment'], 'string'],
             [['comment'], 'default', 'value' => null],
             [['slot_type_id', 'date_add', 'date_end', 'time_end', 'salary_shift', 'price_hour', 'work_time', 'autoclosed'], 'safe'],
-            [['date_shift'], 'date', 'format' => 'yyyy-M-d'],
+            [['date'], 'date', 'format' => 'yyyy-M-d'],
             [['time_start', 'shift_id'], 'required'],
         ];
     }
@@ -154,7 +154,7 @@ class TimetableFactModel extends ActiveRecord
             $model->admin_group_id = Admin::findOne(['id' => $adminCheckin->admin_id])->group_id;
             $model->d_id = $adminCheckin->d_id;
             $model->store_id = $adminCheckin->store_id;
-            $model->date_shift = $adminCheckin->date;
+            $model->date = $adminCheckin->date;
         }
 
         $model->is_opening = $is_start;
@@ -180,8 +180,8 @@ class TimetableFactModel extends ActiveRecord
         $fact = self::find()
             ->andWhere(['admin_id' => $adminId])->andWhere([
                 'OR',
-                ['date_shift' => $date],
-                ['date_shift' => date('Y-m-d', strtotime('-1 day'))],
+                ['date' => $date],
+                ['date' => date('Y-m-d', strtotime('-1 day'))],
             ]);
 
         $opening ? $fact->andWhere(['is_opening' => true]) : $fact->andWhere(['is_close' => true]);
@@ -201,7 +201,7 @@ class TimetableFactModel extends ActiveRecord
             'salary_shift',
             // 'price' => fn($x) => $x->shift_id == 2 ? 140 : 125,
             'tabel',
-            'date' => fn($x) => $x->date_shift,
+            'date' => fn($x) => $x->date,
             'date_start' =>  fn($x) => $x->date_start . ' ' .$x->time_start,
             'date_end' => fn($x) => !empty($x->date_end) ? $x->date_end . ' ' .$x->time_end : null,
             'time_start',
index ac7fd4d26b88d73137c72dd3901a12f6f32b5b83..501d251e34b872fdb8966788e3355fde7913e301 100755 (executable)
@@ -3723,8 +3723,8 @@ false
     {
         $query = TimetableFactModel::find()
             ->with('admin')
-            ->andWhere(['>=', 'date_shift', $dateFrom])
-            ->andWhere(['<=', 'date_shift', $dateTo])
+            ->andWhere(['>=', 'date', $dateFrom])
+            ->andWhere(['<=', 'date', $dateTo])
             ->andWhere(['admin_id' => $adminId])
         ;
 
@@ -3736,7 +3736,7 @@ false
             }
         }
 
-        $query->orderBy(['date_shift' => SORT_ASC]);
+        $query->orderBy(['date' => SORT_ASC]);
         $query->indexBy(['id']);
 //        $query->groupBy(['date_shift']);
 
@@ -3747,10 +3747,10 @@ false
         $timetableFactForMonth = [];
         $listDateCount = [];
         foreach ($timetableFactForMonthPrepared as $key => $row) {
-            if (!array_key_exists($row['date_shift'], $listDateCount)) {
-                $listDateCount[$row['date_shift']] = 1;
+            if (!array_key_exists($row['date'], $listDateCount)) {
+                $listDateCount[$row['date']] = 1;
                 $timetableFactForMonth[$key] = $row;
-                $timetableFactForMonth[$key]['date'] = $row['date_shift'];
+                $timetableFactForMonth[$key]['date'] = $row['date'];
             }
         }
 
@@ -3899,8 +3899,8 @@ Group BY admin_id
 
         $query = TimetableFactModel::find()
             ->joinWith('admin')
-            ->andWhere(['>=', 'date_shift', $dateFrom])
-            ->andWhere(['<=', 'date_shift', $dateTo])
+            ->andWhere(['>=', 'date', $dateFrom])
+            ->andWhere(['<=', 'date', $dateTo])
             ->andWhere(['<>','admin.group_id', -1])
             ->andWhere(['admin_id' => $adminId])
             ->andWhere(['shift_id' => $shiftIdForDict])
@@ -3917,16 +3917,16 @@ Group BY admin_id
         $query->indexBy(['id']);
 
         $adminTable = $query->asArray()->all();
-        $adminTableDateColumn = array_values(ArrayHelper::getColumn($adminTable, 'date_shift'));
+        $adminTableDateColumn = array_values(ArrayHelper::getColumn($adminTable, 'date'));
         $adminTableDays = array_unique(array_values($adminTableDateColumn));
         sort($adminTableDays);
 
         /** @var TimetableFactModel[] $timetable */
         $queryOtherAdminDay = TimetableFactModel::find()
-            ->select(['date_shift' => new \yii\db\Expression("DISTINCT(date_shift)"), 'id'])
-            ->andWhere(['>=', 'date_shift', $dateFrom])
-            ->andWhere(['<=', 'date_shift', $dateTo])
-            ->andWhere(['not in', 'date_shift', $adminTableDays])
+            ->select(['date' => new \yii\db\Expression("DISTINCT(date)"), 'id'])
+            ->andWhere(['>=', 'date', $dateFrom])
+            ->andWhere(['<=', 'date', $dateTo])
+            ->andWhere(['not in', 'date', $adminTableDays])
             ->andWhere(['<>', 'admin_id', $adminId])
             ->andWhere(['shift_id' => $shiftIdForDict])
         ;
@@ -3946,15 +3946,15 @@ Group BY admin_id
         $adminTable2 = [];
 
         foreach ($adminTablePrepared2 as $item) {
-            if (in_array($item['date_shift'], $dateArray)) {
+            if (in_array($item['date'], $dateArray)) {
                 continue;
             } else {
-                $dateArray[] = $item['date_shift'];
+                $dateArray[] = $item['date'];
                 $adminTable2[] = $item;
             }
         }
 
-        $adminTableDateColumn2 = array_values(ArrayHelper::getColumn($adminTable2, 'date_shift'));
+        $adminTableDateColumn2 = array_values(ArrayHelper::getColumn($adminTable2, 'date'));
         $adminTableIdDay = array_values(ArrayHelper::getColumn($adminTable2, 'id'));
         $adminTableNight = array_values($adminTableDateColumn2);
 
@@ -3963,10 +3963,10 @@ Group BY admin_id
 
         /** @var TimetableFactModel[] $timetable */
         $queryOtherAdminNight = TimetableFactModel::find()
-            ->select(['date_shift' => new \yii\db\Expression("DISTINCT(date_shift)"), 'id'])
-            ->andWhere(['>=', 'date_shift', $dateFrom])
-            ->andWhere(['<=', 'date_shift', $dateTo])
-            ->andWhere(['not in', 'date_shift', $adminTableDaysLast])
+            ->select(['date' => new \yii\db\Expression("DISTINCT(date)"), 'id'])
+            ->andWhere(['>=', 'date', $dateFrom])
+            ->andWhere(['<=', 'date', $dateTo])
+            ->andWhere(['not in', 'date', $adminTableDaysLast])
             ->andWhere(['<>', 'admin_id', $adminId])
             ->andWhere(['shift_id' => $shiftIdForDict])
         ;
@@ -3988,8 +3988,8 @@ Group BY admin_id
         $query = TimetableFactModel::find()
             ->indexBy('id')
             ->with('admin')
-            ->andWhere(['>=', 'date_shift', $dateFrom])
-            ->andWhere(['<=', 'date_shift', $dateTo])
+            ->andWhere(['>=', 'date', $dateFrom])
+            ->andWhere(['<=', 'date', $dateTo])
             ->andWhere(['id' => $adminTableIds])
             ->andWhere(['shift_id' => $shiftIdForDict])
         ;
@@ -4014,13 +4014,13 @@ Group BY admin_id
                 $result,
 
                 function ($a, $b) {
-                    return (strtotime($a['date_shift']) - strtotime($b['date_shift']));
+                    return (strtotime($a['date']) - strtotime($b['date']));
                 }
             );
         }
 
         foreach ($result as $key => $row) {
-            $result[$key]['date'] = $result[$key]['date_shift'];
+            $result[$key]['date'] = $result[$key]['date'];
         }
 
         return $result;
@@ -4274,7 +4274,7 @@ Group BY admin_id
 
         $query = TimetableFactModel::find()
             ->joinWith('admin')
-            ->andWhere(['date_shift' => $date])
+            ->andWhere(['date' => $date])
             ->andWhere(['<>','admin.group_id', -1])
             ->andWhere(['timetable_fact.store_id' => $storeId])
             ->andWhere(['shift_id' => $shiftIdForDict])
@@ -4290,14 +4290,14 @@ Group BY admin_id
         $listDateCount = [];
         if (!empty($timetableFactPrepared)) {
             foreach ($timetableFactPrepared as $key => $row) {
-                if (!array_key_exists($row['date_shift'], $listDateCount)) {
-                    $listDateCount[$row['date_shift']] = 1;
+                if (!array_key_exists($row['date'], $listDateCount)) {
+                    $listDateCount[$row['date']] = 1;
 
                 } else {
-                    $listDateCount[$row['date_shift']] = $listDateCount[$row['date_shift']] + 1;
+                    $listDateCount[$row['date']] = $listDateCount[$row['date']] + 1;
                 }
                 $timetableFact[$key] = $row;
-                $timetableFact[$key]['date'] = $row['date_shift'];
+                $timetableFact[$key]['date'] = $row['date'];
             }
         }
 
index 74590dcbf70e824f00bc9e9125463b906b2e0e5a..a3058570965d79458eba34aded29faf20e360b2e 100644 (file)
@@ -764,13 +764,13 @@ class MotivationService
         $motivation = Motivation::find()->where(['store_id' => $store_id, 'year' => $year, 'month' => $month])->one();
         if ($motivation) {
             $timetableFactModels = TimetableFactModel::find()->select(['DISTINCT(admin_id) as admin_id'])->where(['store_id' => $store_id])
-                ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])->all();
+                ->andWhere(['between', 'date', $monthStart, $monthEnd])->all();
             $adminIds = ArrayHelper::getColumn($timetableFactModels, 'admin_id');
 
             $result = 0;
             foreach ($adminIds as $admin_id) {
                 $timetableFactModel = TimetableFactModel::find()->select(['COUNT(*) as total', 'admin_group_id'])->where(['store_id' => $store_id, 'admin_id' => $admin_id])
-                    ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one();
+                    ->andWhere(['between', 'date', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one();
 
                 $norma = 15;
                 if ($timetableFactModel['admin_group_id'] != AdminGroup::GROUP_WORKERS) {
@@ -801,7 +801,7 @@ class MotivationService
         // Делаем запрос к TimetableFactModel
         $records = TimetableFactModel::find()
             ->where(['store_id' => $storeId])
-            ->andWhere(['between', 'date_shift', $startDate, $endDate])
+            ->andWhere(['between', 'date', $startDate, $endDate])
             ->all();
 
         return $records;
@@ -1402,7 +1402,7 @@ class MotivationService
 
         $timetableFactModels = TimetableFactModel::find()->select(['COUNT(DISTINCT(admin_id)) as cnt', 'store_id'])
             ->where(['!=', 'admin_group_id', '45'])
-            ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])
+            ->andWhere(['between', 'date', $monthStart, $monthEnd])
             ->groupBy(['store_id'])
             ->indexBy('store_id')
             ->asArray()->all();
index 1a82cd6dc712acd6d03e022dad5d722293e0cb3b..a1ea771edf771515b5a5f152ae0318ec18d9afbe 100644 (file)
@@ -61,7 +61,7 @@ $this->title = 'Результаты расчета зарплат по неде
                     <td><?= Html::encode($record['admin_name']) ?></td>
                     <td><?= Html::encode($record['salary_shift']) ?></td>
                     <td><?= Html::encode($record['daily_payment']) ?></td>
-                    <td><?= Html::encode($record['date_shift']) ?></td>
+                    <td><?= Html::encode($record['date']) ?></td>
                 </tr>
             <?php endforeach; ?>
             </tbody>
index 8932883f18daab61bfe3d5e61cfeca490e7973da..43ee9ec8a081341dca588f6bab2eaea8e255024b 100644 (file)
@@ -143,7 +143,7 @@ $this->params['breadcrumbs'][] = $this->title;
             ],
             [
                 'label' => 'Дата смены',
-                'attribute' => 'date_shift',
+                'attribute' => 'date',
                 'format' => ['date', 'php:d.m.Y'],
             ],
             [
index 637dba1c47884bade5c7e69f98848a186ce535e1..21a96fd2415f479d7bf749d10592a140283c2b34 100644 (file)
@@ -11,7 +11,7 @@ use \yii\widgets\ActiveForm;
 
 <?php $columns = array(
     ['class' => 'yii\grid\SerialColumn'],
-    'date_shift:datetime',
+    'date:datetime',
     [
         'attribute' => 'admin_id',
         'value' => function ($data) {
index f17f74a5d8a2598e6e0c51776472fe8cfce1f14b..4b434575ea6b72fe8b6c236b4fcc3679786cb667 100644 (file)
@@ -57,10 +57,10 @@ $this->title = "Фактический табель #$model->id";
                 }
             ],
             [
-                'attribute' => 'date_shift',
+                'attribute' => 'date',
                 'format' => 'raw',
                 'value' => function ($model) {
-                    return Yii::$app->formatter->asDatetime($model->date_shift, 'php:d.m.Y');
+                    return Yii::$app->formatter->asDatetime($model->date, 'php:d.m.Y');
                 },
             ],
             [
index d46a189d8eadce9a2f3641a447b5c09d24a5e1fc..7acb297b4881e901021a4958a6c3b0e899f7a149 100644 (file)
@@ -89,7 +89,7 @@ use \yii\base\DynamicModel;
                 <tr>
                     <td style="text-decoration: underline; color: blue;" onclick="document.querySelector('#dynamicmodel-timetable_fact_id').value = this.innerHTML"><?= $timetableFact->id ?></td>
                     <td><?= $stores[$timetableFact->store_id] ?? '' ?></td>
-                    <td><?= $timetableFact->date_shift ?></td>
+                    <td><?= $timetableFact->date ?></td>
                     <td><?= $timetableFact->time_start ?></td>
                     <td><?= $timetableFact->time_end ?></td>
                     <td><?= $timetableFact->checkin_start_id ?></td>
index 7a8b053332fd0f4b54241ec49ab95e84ee34a8bb..13f558dc860ed54218bcaa08c6930ab319f09e12 100755 (executable)
@@ -195,7 +195,7 @@ $regroupedTimetableFact = ArrayHelper::index($timetableFact, 'date', ['admin_id'
 /** @var TimetableFactModel[][] $regroupedTimetableFactModel */
 $regroupedTimetableFactModel = [];
 foreach($timetableFactModel as $ttfm) {
-    $regroupedTimetableFactModel[$ttfm->admin_id][$ttfm->date_shift][] = $ttfm;
+    $regroupedTimetableFactModel[$ttfm->admin_id][$ttfm->date][] = $ttfm;
 }
 
 $rowNumber = 0;
index 2d09465a219c5adde88f83b5ee7cbf44f76b91a0..527395a72eedad9d56e0c01c77631800b76ff3ca 100755 (executable)
@@ -143,7 +143,7 @@ if (Timetable::getAllowEditShift($slot->date, $numDay)) {
         ],
         [
             'label' => 'Дата смены',
-            'attribute' => 'date_shift',
+            'attribute' => 'date',
             'format' => ['date', 'php:d.m.Y'],
         ],
         [