From: Alexander Smirnov Date: Tue, 2 Apr 2024 10:25:33 +0000 (+0300) Subject: fix storeId is null bad for pgsql X-Git-Tag: 1.1~162^2~7 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=628007181d8ed4353c44d76045113746d3fc514f;p=erp24_rep%2Fyii-erp24%2F.git fix storeId is null bad for pgsql --- 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 (