From a3dffc5cc51be9e89580472990d1a9fe42a4eba3 Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 18 Sep 2024 16:01:15 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD?= =?utf8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20date=5Fshift=20TimetableF?= =?utf8?q?actModel.php=20=D0=B2=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/motivation/GetSalaryAction.php | 2 +- erp24/actions/timetable/AddFactHandAction.php | 8 +-- erp24/actions/timetable/EditPlanAction.php | 2 +- .../timetable/StartShiftStepTwoAction.php | 2 +- erp24/api3/core/services/TimetableService.php | 2 +- erp24/api3/modules/v1/models/Admin.php | 2 +- erp24/commands/TimetableController.php | 2 +- erp24/controllers/TimetableFactController.php | 26 ++++----- ...24420_change_table_name_timetable_fact.php | 40 +++++++++++++ erp24/records/TimetableFactModel.php | 14 ++--- erp24/services/CabinetService.php | 58 +++++++++---------- erp24/services/MotivationService.php | 8 +-- erp24/views/motivation/records.php | 2 +- erp24/views/timetable-fact/index.php | 2 +- erp24/views/timetable-fact/merge-shifts.php | 2 +- erp24/views/timetable-fact/view.php | 4 +- erp24/views/timetable/add-fact-hand.php | 2 +- erp24/views/timetable/plan.php | 2 +- erp24/views/timetable/tabel_edit.php | 2 +- 19 files changed, 111 insertions(+), 71 deletions(-) create mode 100644 erp24/migrations/m240918_124420_change_table_name_timetable_fact.php diff --git a/erp24/actions/motivation/GetSalaryAction.php b/erp24/actions/motivation/GetSalaryAction.php index 0c2e327b..28e2441c 100644 --- a/erp24/actions/motivation/GetSalaryAction.php +++ b/erp24/actions/motivation/GetSalaryAction.php @@ -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 ]; } diff --git a/erp24/actions/timetable/AddFactHandAction.php b/erp24/actions/timetable/AddFactHandAction.php index a6e5ec47..2278629a 100644 --- a/erp24/actions/timetable/AddFactHandAction.php +++ b/erp24/actions/timetable/AddFactHandAction.php @@ -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(); } diff --git a/erp24/actions/timetable/EditPlanAction.php b/erp24/actions/timetable/EditPlanAction.php index 5208d517..a6db9656 100755 --- a/erp24/actions/timetable/EditPlanAction.php +++ b/erp24/actions/timetable/EditPlanAction.php @@ -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, diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index 9132305e..06e35690 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -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()) { diff --git a/erp24/api3/core/services/TimetableService.php b/erp24/api3/core/services/TimetableService.php index a4a04520..93b70a2b 100644 --- a/erp24/api3/core/services/TimetableService.php +++ b/erp24/api3/core/services/TimetableService.php @@ -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; diff --git a/erp24/api3/modules/v1/models/Admin.php b/erp24/api3/modules/v1/models/Admin.php index 9260af70..ed684f50 100644 --- a/erp24/api3/modules/v1/models/Admin.php +++ b/erp24/api3/modules/v1/models/Admin.php @@ -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', ]) diff --git a/erp24/commands/TimetableController.php b/erp24/commands/TimetableController.php index e3ce4e3b..050f999d 100644 --- a/erp24/commands/TimetableController.php +++ b/erp24/commands/TimetableController.php @@ -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; diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index 133edfb3..70184d3b 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -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 index 00000000..57f538db --- /dev/null +++ b/erp24/migrations/m240918_124420_change_table_name_timetable_fact.php @@ -0,0 +1,40 @@ +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; + } + */ +} diff --git a/erp24/records/TimetableFactModel.php b/erp24/records/TimetableFactModel.php index 6c0c56bd..33af9f50 100644 --- a/erp24/records/TimetableFactModel.php +++ b/erp24/records/TimetableFactModel.php @@ -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', diff --git a/erp24/services/CabinetService.php b/erp24/services/CabinetService.php index ac7fd4d2..501d251e 100755 --- a/erp24/services/CabinetService.php +++ b/erp24/services/CabinetService.php @@ -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']; } } diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 74590dcb..a3058570 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -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(); diff --git a/erp24/views/motivation/records.php b/erp24/views/motivation/records.php index 1a82cd6d..a1ea771e 100644 --- a/erp24/views/motivation/records.php +++ b/erp24/views/motivation/records.php @@ -61,7 +61,7 @@ $this->title = 'Результаты расчета зарплат по неде - + diff --git a/erp24/views/timetable-fact/index.php b/erp24/views/timetable-fact/index.php index 8932883f..43ee9ec8 100644 --- a/erp24/views/timetable-fact/index.php +++ b/erp24/views/timetable-fact/index.php @@ -143,7 +143,7 @@ $this->params['breadcrumbs'][] = $this->title; ], [ 'label' => 'Дата смены', - 'attribute' => 'date_shift', + 'attribute' => 'date', 'format' => ['date', 'php:d.m.Y'], ], [ diff --git a/erp24/views/timetable-fact/merge-shifts.php b/erp24/views/timetable-fact/merge-shifts.php index 637dba1c..21a96fd2 100644 --- a/erp24/views/timetable-fact/merge-shifts.php +++ b/erp24/views/timetable-fact/merge-shifts.php @@ -11,7 +11,7 @@ use \yii\widgets\ActiveForm; 'yii\grid\SerialColumn'], - 'date_shift:datetime', + 'date:datetime', [ 'attribute' => 'admin_id', 'value' => function ($data) { diff --git a/erp24/views/timetable-fact/view.php b/erp24/views/timetable-fact/view.php index f17f74a5..4b434575 100644 --- a/erp24/views/timetable-fact/view.php +++ b/erp24/views/timetable-fact/view.php @@ -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'); }, ], [ diff --git a/erp24/views/timetable/add-fact-hand.php b/erp24/views/timetable/add-fact-hand.php index d46a189d..7acb297b 100644 --- a/erp24/views/timetable/add-fact-hand.php +++ b/erp24/views/timetable/add-fact-hand.php @@ -89,7 +89,7 @@ use \yii\base\DynamicModel; id ?> store_id] ?? '' ?> - date_shift ?> + date ?> time_start ?> time_end ?> checkin_start_id ?> diff --git a/erp24/views/timetable/plan.php b/erp24/views/timetable/plan.php index 7a8b0533..13f558dc 100755 --- a/erp24/views/timetable/plan.php +++ b/erp24/views/timetable/plan.php @@ -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; diff --git a/erp24/views/timetable/tabel_edit.php b/erp24/views/timetable/tabel_edit.php index 2d09465a..527395a7 100755 --- a/erp24/views/timetable/tabel_edit.php +++ b/erp24/views/timetable/tabel_edit.php @@ -143,7 +143,7 @@ if (Timetable::getAllowEditShift($slot->date, $numDay)) { ], [ 'label' => 'Дата смены', - 'attribute' => 'date_shift', + 'attribute' => 'date', 'format' => ['date', 'php:d.m.Y'], ], [ -- 2.39.5