From: marina Date: Tue, 28 Jan 2025 08:02:10 +0000 (+0300) Subject: ERP-282 Нужно сделать интерфейс настройки магазина X-Git-Tag: 1.7~35^2~8 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=41139e0435aaba8e2e6a62441678039f83e316cb;p=erp24_rep%2Fyii-erp24%2F.git ERP-282 Нужно сделать интерфейс настройки магазина --- diff --git a/erp24/controllers/CityStoreParamsController.php b/erp24/controllers/CityStoreParamsController.php index c9b1b571..76691b91 100644 --- a/erp24/controllers/CityStoreParamsController.php +++ b/erp24/controllers/CityStoreParamsController.php @@ -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([