From 628007181d8ed4353c44d76045113746d3fc514f Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Tue, 2 Apr 2024 13:25:33 +0300 Subject: [PATCH] fix storeId is null bad for pgsql --- erp24/actions/timetable/EditPlanAction.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erp24/actions/timetable/EditPlanAction.php b/erp24/actions/timetable/EditPlanAction.php index 5db84ca6..6865f36f 100755 --- a/erp24/actions/timetable/EditPlanAction.php +++ b/erp24/actions/timetable/EditPlanAction.php @@ -37,11 +37,14 @@ class EditPlanAction extends Action 'date' => $this->controller->request->get('date'), 'store_id' => $this->controller->request->get('storeId'), ]; + /** @var Admin $admin */ + $admin = Admin::find()->andWhere(['id'=>$row['admin_id']])->one(); + if ($row['store_id'] == 'null') { + $row['store_id'] = $admin->store_id ?? null; + } $slot = TimetablePlan::find()->andWhere($row)->one(); if (!$slot) { $slot = new TimetablePlan($row); - /** @var Admin $admin */ - $admin = Admin::find()->andWhere(['id'=>$row['admin_id']])->one(); $slot->store_id = $this->controller->request->get('storeId') ?? ($admin ? $admin->store_id : null); if ( -- 2.39.5