Browse Source

sunguidong

zhangguidong 2 years ago
parent
commit
c2c1d25337
1 changed files with 9 additions and 6 deletions
  1. 9 6
      app/shop/controller/Goods.php

+ 9 - 6
app/shop/controller/Goods.php

@@ -416,12 +416,15 @@ class Goods extends BaseShop
 			$goods_category_list = $goods_category_model->getCategoryList($condition, 'category_id,category_name,level,commission_rate');
 			$goods_category_list = $goods_category_list['data'];
 			$this->assign("goods_category_list", $goods_category_list);
-			
-			//获取品牌;
-			$goods_brand_model = new GoodsBrandModel();
-			$brand_list = $goods_brand_model->getBrandList([ [ 'site_id', 'in', ("0,$this->site_id") ] ], "brand_id, brand_name");
-			$brand_list = $brand_list['data'];
-			$this->assign("brand_list", $brand_list);
+
+
+            $shop_model = new \app\model\shop\Shop();
+            $shop_brand_id = $shop_model->getShopInfo([['site_id','=',$this->site_id]],'brand_id');
+            //获取品牌;
+            $goods_brand_model = new GoodsBrandModel();
+            $brand_list = $goods_brand_model->getBrandList([ [ 'brand_id', '=', $shop_brand_id['data']['brand_id'] ] ], "brand_id, brand_name");
+            $brand_list = $brand_list['data'];
+            $this->assign("brand_list", $brand_list);
 			
 			//获取店内分类
 			$goods_shop_category_model = new GoodsShopCategoryModel();