Authored by 周少峰

shop index brand list

@@ -103,6 +103,11 @@ class ShopProcess @@ -103,6 +103,11 @@ class ShopProcess
103 */ 103 */
104 private static function brandBrowse($data) 104 private static function brandBrowse($data)
105 { 105 {
  106 + $brandNumber = count($data);
  107 + //少于2个不展示
  108 + if ($brandNumber < 2) {
  109 + return;
  110 + }
106 foreach ($data as $val) { 111 foreach ($data as $val) {
107 self::$shopData['brandList']['list'][] = array( 112 self::$shopData['brandList']['list'][] = array(
108 'url' => Helpers::url('', '', $val['brandDomain']), 113 'url' => Helpers::url('', '', $val['brandDomain']),
@@ -110,7 +115,8 @@ class ShopProcess @@ -110,7 +115,8 @@ class ShopProcess
110 'brandName' => $val['brandName'] 115 'brandName' => $val['brandName']
111 ); 116 );
112 } 117 }
113 - if (count($data) > 5) { 118 + //大于5个返回更多品牌链接
  119 + if ($brandNumber > 5) {
114 self::$shopData['brandList']['url'] = Helpers::url('/product/index/allBrand', array('shop_id' => self::$shopId)); 120 self::$shopData['brandList']['url'] = Helpers::url('/product/index/allBrand', array('shop_id' => self::$shopId));
115 } 121 }
116 } 122 }
@@ -170,7 +176,7 @@ class ShopProcess @@ -170,7 +176,7 @@ class ShopProcess
170 { 176 {
171 if (isset($data['code']) && $data['code'] == 200 && !empty($data['data'])) { 177 if (isset($data['code']) && $data['code'] == 200 && !empty($data['data'])) {
172 $total = count($data['data']); 178 $total = count($data['data']);
173 - if ($total > 5) { 179 + if ($total > 6) {
174 self::$shopData['shopCategory']['url'] = Helpers::url('/product/index/category', array('shop_id' => self::$shopId)); 180 self::$shopData['shopCategory']['url'] = Helpers::url('/product/index/category', array('shop_id' => self::$shopId));
175 return; 181 return;
176 } 182 }
@@ -413,17 +413,12 @@ class ListModel @@ -413,17 +413,12 @@ class ListModel
413 public static function shopData($shopId, $uid) 413 public static function shopData($shopId, $uid)
414 { 414 {
415 $data = array(); 415 $data = array();
416 - //TODO 用户是否收藏  
417 - if (!empty($uid)) {  
418 -  
419 - }  
420 //店铺信息 416 //店铺信息
421 $data['shopInfo'] = ListData::getShopInfo($shopId, $uid); 417 $data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
422 //店铺分类 418 //店铺分类
423 $data['shopCategory'] = ListData::getShopCategory($shopId); 419 $data['shopCategory'] = ListData::getShopCategory($shopId);
424 //店铺装修资源数据 420 //店铺装修资源数据
425 $data['decorator'] = ListData::getShopDecorator($shopId); 421 $data['decorator'] = ListData::getShopDecorator($shopId);
426 -// print_r($data);  
427 //组织楼层数据 422 //组织楼层数据
428 $result = ShopProcess::formShopData($data, $shopId); 423 $result = ShopProcess::formShopData($data, $shopId);
429 return $result; 424 return $result;
@@ -135,6 +135,11 @@ class IndexController extends AbstractAction @@ -135,6 +135,11 @@ class IndexController extends AbstractAction
135 $uid = $this->getUid(); 135 $uid = $this->getUid();
136 // 存标题信息 136 // 存标题信息
137 $title = ''; 137 $title = '';
  138 + //TODO 如果是app,可直接获取shopId
  139 +// $appShopId = $this->get('shop_id');
  140 +// if ($this->isApp() && !empty($appShopId)) {
  141 +// $this->shop($appShopId);
  142 +// }
138 //TODO 通过品牌域名获取店铺shopId 先固定shopId = 672 143 //TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
139 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title); 144 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
140 $brandLogo['shopId'] = 672; 145 $brandLogo['shopId'] = 672;
@@ -147,8 +152,6 @@ class IndexController extends AbstractAction @@ -147,8 +152,6 @@ class IndexController extends AbstractAction
147 $brandId = $brandLogo['id']; 152 $brandId = $brandLogo['id'];
148 } 153 }
149 154
150 -  
151 -  
152 /* 搜索框相关 */ 155 /* 搜索框相关 */
153 $from = $this->get('from'); 156 $from = $this->get('from');
154 $query = $this->get('query'); 157 $query = $this->get('query');