Authored by 郝肖肖

获取店铺信息 判断是否是基础模板

@@ -695,7 +695,7 @@ class ShopModel @@ -695,7 +695,7 @@ class ShopModel
695 695
696 public static function getIntro($shopId, $uid) 696 public static function getIntro($shopId, $uid)
697 { 697 {
698 - $data = array('brandName' => '', 'brandCont' => '', 'domain'=> '', 'logo'=> '', 'is_favorite'=> false); 698 + $data = array('brandName' => '', 'brandCont' => '', 'domain'=> '', 'logo'=> '', 'is_favorite'=> false, 'multBrandShopType' => 0);
699 699
700 $intro = ShopData::getIntro($shopId, $uid); 700 $intro = ShopData::getIntro($shopId, $uid);
701 701
@@ -706,7 +706,7 @@ class ShopModel @@ -706,7 +706,7 @@ class ShopModel
706 'domain'=> $intro['data']['shop_domain'], 706 'domain'=> $intro['data']['shop_domain'],
707 'logo'=> $intro['data']['shop_logo'], 707 'logo'=> $intro['data']['shop_logo'],
708 'isFavorite'=> ($intro['data']['is_favorite'] === 'Y'), 708 'isFavorite'=> ($intro['data']['is_favorite'] === 'Y'),
709 - 'multBrandShopType'=> $intro['data']['mult_brand_shop_type'] 709 + 'multBrandShopType'=> intval($intro['data']['mult_brand_shop_type'])
710 ); 710 );
711 } 711 }
712 712
@@ -27,7 +27,11 @@ class IndexController extends WebAction @@ -27,7 +27,11 @@ class IndexController extends WebAction
27 if (!$result) { 27 if (!$result) {
28 $this->go(SITE_MAIN); 28 $this->go(SITE_MAIN);
29 } 29 }
30 - 30 +
  31 + //获取uid
  32 + $uid = $this->getUid();
  33 +
  34 +
31 $type = intval(isset($result['type']) ? $result['type'] : ''); 35 $type = intval(isset($result['type']) ? $result['type'] : '');
32 switch ($type) { 36 switch ($type) {
33 case 1: 37 case 1:
@@ -36,6 +40,13 @@ class IndexController extends WebAction @@ -36,6 +40,13 @@ class IndexController extends WebAction
36 //无单品店有多品店:1--->搜索页 40 //无单品店有多品店:1--->搜索页
37 $this->go('http://search.yohobuy.com/?query=' . $domain); 41 $this->go('http://search.yohobuy.com/?query=' . $domain);
38 } else { 42 } else {
  43 + $shopIntro = ShopModel::getIntro($shopId, $uid);
  44 + if (!empty($shopIntro['multBrandShopType']) && $shopIntro['multBrandShopType'] === 1) {
  45 + //基础模板多个品牌
  46 + $result['shopTemplateType'] = $shopIntro['multBrandShopType'];
  47 + $result['shopId'] = $shopIntro['shopId'];
  48 + break;
  49 + }
39 $this->shopHome($shopId); 50 $this->shopHome($shopId);
40 } 51 }
41 exit(0); 52 exit(0);
@@ -47,21 +58,19 @@ class IndexController extends WebAction @@ -47,21 +58,19 @@ class IndexController extends WebAction
47 $this->shopHome($result['shopId']); 58 $this->shopHome($result['shopId']);
48 exit(0); 59 exit(0);
49 } 60 }
50 - //基础模板  
51 - if ($result['shopTemplateType'] === 1 && !empty($result['shopId'])) {  
52 - $basisData = ShopModel::basisTemplate($result['shopId']);  
53 - $result['brandBanner'] = empty($basisData['shopTopBanner_base']['banner']) ?  
54 - $result['brandBanner'] : $basisData['shopTopBanner_base']['banner'] . '?';  
55 - $result['signboard'] = $basisData['signboard'];  
56 - if (isset($result['node'])) {  
57 - unset($result['node']);  
58 - }  
59 - }  
60 break; 61 break;
61 } 62 }
62 63
63 - //获取uid  
64 - $uid = $this->getUid(); 64 + //基础模板
  65 + if (!empty($result['shopTemplateType']) && $result['shopTemplateType'] === 1 && !empty($result['shopId'])) {
  66 + $basisData = ShopModel::basisTemplate($result['shopId']);
  67 + $result['brandBanner'] = empty($basisData['shopTopBanner_base']['banner']) ?
  68 + $result['brandBanner'] : $basisData['shopTopBanner_base']['banner'] . '?';
  69 + $result['signboard'] = $basisData['signboard'];
  70 + if (isset($result['node'])) {
  71 + unset($result['node']);
  72 + }
  73 + }
65 74
66 //传品牌ID参数 75 //传品牌ID参数
67 $condition = array(); 76 $condition = array();