Authored by 周少峰

brandshop access

@@ -434,7 +434,7 @@ class ListModel @@ -434,7 +434,7 @@ class ListModel
434 public static function getBrandShops($brandId) 434 public static function getBrandShops($brandId)
435 { 435 {
436 $result = array(); 436 $result = array();
437 - $brandShop = ShopData::getShopByBrandId(1559); 437 + $brandShop = ShopData::getShopByBrandId($brandId);
438 if (isset($brandShop['code']) && $brandShop['code'] && !empty($brandShop['data'])) { 438 if (isset($brandShop['code']) && $brandShop['code'] && !empty($brandShop['data'])) {
439 foreach ($brandShop['data'] as $key => $val) { 439 foreach ($brandShop['data'] as $key => $val) {
440 $result[$key]['url'] = Helpers::url('/product/index/brand/', array('shop_id', $val['shop_id'])); 440 $result[$key]['url'] = Helpers::url('/product/index/brand/', array('shop_id', $val['shop_id']));
@@ -133,7 +133,6 @@ class IndexController extends AbstractAction @@ -133,7 +133,6 @@ class IndexController extends AbstractAction
133 } 133 }
134 /* 品牌域名参数 @see Bootstrap.php */ 134 /* 品牌域名参数 @see Bootstrap.php */
135 $domain = $this->param('named'); 135 $domain = $this->param('named');
136 -// $domain = 'andybrier';  
137 if (empty($domain)) { 136 if (empty($domain)) {
138 $this->go(SITE_MAIN); 137 $this->go(SITE_MAIN);
139 } 138 }
@@ -142,6 +141,7 @@ class IndexController extends AbstractAction @@ -142,6 +141,7 @@ class IndexController extends AbstractAction
142 // 存标题信息 141 // 存标题信息
143 $title = ''; 142 $title = '';
144 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title); 143 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
  144 +// print_r($brandLogo); exit;
145 //无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面 145 //无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
146 // $brandLogo['shopId'] = 672; 146 // $brandLogo['shopId'] = 672;
147 // $brandLogo['type'] = 2; 147 // $brandLogo['type'] = 2;
@@ -155,9 +155,6 @@ class IndexController extends AbstractAction @@ -155,9 +155,6 @@ class IndexController extends AbstractAction
155 } 155 }
156 //获取品牌店铺信息 156 //获取品牌店铺信息
157 $brandShop = $this->brandShop($brandId); 157 $brandShop = $this->brandShop($brandId);
158 - if (!empty($brandShop)) {  
159 - $brandLogo = $brandShop;  
160 - }  
161 /* 搜索框相关 */ 158 /* 搜索框相关 */
162 $from = $this->get('from'); 159 $from = $this->get('from');
163 $query = $this->get('query'); 160 $query = $this->get('query');
@@ -228,11 +225,11 @@ class IndexController extends AbstractAction @@ -228,11 +225,11 @@ class IndexController extends AbstractAction
228 $data = array(); 225 $data = array();
229 $data['goodListPage'] = true; 226 $data['goodListPage'] = true;
230 $data['showDownloadApp'] = true; 227 $data['showDownloadApp'] = true;
231 - // 从搜索页过来的,显示搜索框, 和进入品牌引导信息  
232 - if ($from === 'search') { 228 + // 从搜索页过来的,显示搜索框, 和进入品牌引导信息 或者品牌关联多店铺
  229 + if ($from === 'search' || !empty($brandShop)) {
233 $data['goodList'] = array(); 230 $data['goodList'] = array();
234 //$data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandId, $title); 231 //$data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandId, $title);
235 - $data['goodList']['brandWay'] = $brandLogo; 232 + $data['goodList']['brandWay'] = $brandShop ? $brandShop : $brandLogo;
236 $data['goodList']['search']['default'] = $query; 233 $data['goodList']['search']['default'] = $query;
237 $data['goodList']['search']['url'] = Helpers::url('', null, 'search'); 234 $data['goodList']['search']['url'] = Helpers::url('', null, 'search');
238 } // 品牌一览过来的展示品牌介绍和LOGO 235 } // 品牌一览过来的展示品牌介绍和LOGO