]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-282 Нужно сделать интерфейс настройки магазина
authormarina <m.zozirova@gmail.com>
Tue, 28 Jan 2025 08:02:10 +0000 (11:02 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 28 Jan 2025 08:02:10 +0000 (11:02 +0300)
erp24/controllers/CityStoreParamsController.php

index c9b1b571caee2d7a8e96c8c8022897e1e533240b..76691b910e91f7a21311d7df5028741b9457faca 100644 (file)
@@ -118,22 +118,24 @@ class CityStoreParamsController extends Controller
         $territorialManager = $data['territorial_manager'] ?? '';
         $bushChefFlorist = $data['bush_chef_florist'] ?? '';
 
-        $territorialManagerQuery = StoreDynamic::find()->andFilterWhere(['category' => 1, 'active' => 1]);
-        $bushChefFloristQuery = StoreDynamic::find()->andFilterWhere(['category' => 2, 'active' => 1]);
+        $query = StoreDynamic::find()->andFilterWhere(['active' => 1]);
 
         if ($territorialManager) {
-            $territorialManagerQuery->andFilterWhere(['value_int' => ClusterAdmin::find()
-                ->andFilterWhere(['admin_id' => $territorialManager, 'active' => 1])
-                ->select('cluster_id')
-                ->column()]);
+            $query->andFilterWhere([
+                'category' => 3,
+                'value_int' => ClusterAdmin::find()
+                    ->andFilterWhere(['admin_id' => $territorialManager, 'active' => 1])
+                    ->select('cluster_id')
+                    ->column()
+            ]);
         }
 
         if ($bushChefFlorist) {
-            $bushChefFloristQuery->andWhere(['value_int' => $bushChefFlorist]);
+            $query->andWhere(['category' => 2, 'value_int' => $bushChefFlorist]);
         }
 
-        $territorialManagerStoreIds = $territorialManagerQuery->select('store_id')->column();
-        $bushChefFloristStoreIds = $bushChefFloristQuery->select('store_id')->column();
+        $territorialManagerStoreIds = $query->select('store_id')->column();
+        $bushChefFloristStoreIds = $query->select('store_id')->column();
 
         $stores = CityStore::find()
             ->andFilterWhere([