Authored by hf

code review by fei.hong: do fixes bug to product brand shops show images

@@ -341,15 +341,15 @@ @@ -341,15 +341,15 @@
341 </div> 341 </div>
342 <div class="material-content"> 342 <div class="material-content">
343 {{# material}} 343 {{# material}}
344 - {{#if detail}} 344 + {{#if materialDetail}}
345 <ul class="material-detail"> 345 <ul class="material-detail">
346 - {{# detail}} 346 + {{# materialDetail}}
347 <li class="clearfix"> 347 <li class="clearfix">
348 <img src="{{img}}"> 348 <img src="{{img}}">
349 <p class="name">{{name}}<br>{{enName}}</p> 349 <p class="name">{{name}}<br>{{enName}}</p>
350 <p class="text">{{text}}</p> 350 <p class="text">{{text}}</p>
351 </li> 351 </li>
352 - {{/ detail}} 352 + {{/ materialDetail}}
353 </ul> 353 </ul>
354 {{/if}} 354 {{/if}}
355 355
@@ -34,6 +34,7 @@ class ItemModel @@ -34,6 +34,7 @@ class ItemModel
34 $statGoodsInfo = array(); 34 $statGoodsInfo = array();
35 $banner = array(); 35 $banner = array();
36 $baseInfo = ItemData::baseInfo($productId, $uid, $productSkn); 36 $baseInfo = ItemData::baseInfo($productId, $uid, $productSkn);
  37 +
37 if(empty($baseInfo['productName']) && empty($baseInfo['erpProductId']) && empty($baseInfo['productPriceBo'])) { 38 if(empty($baseInfo['productName']) && empty($baseInfo['erpProductId']) && empty($baseInfo['productPriceBo'])) {
38 return array(); 39 return array();
39 } 40 }
@@ -108,7 +109,6 @@ class ItemModel @@ -108,7 +109,6 @@ class ItemModel
108 109
109 // 是否收藏 110 // 是否收藏
110 $goodsInfo['isCollect'] = $favoriteData['product']; 111 $goodsInfo['isCollect'] = $favoriteData['product'];
111 -  
112 // 限购商品 112 // 限购商品
113 if ($baseInfo['isLimitBuy'] === 'Y') { 113 if ($baseInfo['isLimitBuy'] === 'Y') {
114 // 是否开售 114 // 是否开售
@@ -118,6 +118,7 @@ class ItemModel @@ -118,6 +118,7 @@ class ItemModel
118 if (isset($baseInfo['showStatus'])) { 118 if (isset($baseInfo['showStatus'])) {
119 $showStatus = intval($baseInfo['showStatus']); 119 $showStatus = intval($baseInfo['showStatus']);
120 } 120 }
  121 +
121 $fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale); 122 $fashTopGoods = self::getFashionTopGoodsStatus($uid, $showStatus, $isBeginSale);
122 //潮流尖货状态 123 //潮流尖货状态
123 $goodsInfo['fashionTopGoods'] = array( 124 $goodsInfo['fashionTopGoods'] = array(
@@ -135,7 +136,6 @@ class ItemModel @@ -135,7 +136,6 @@ class ItemModel
135 $goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买 136 $goodsInfo['buyNow'] = $fashTopGoods['buyNow'];//是否立即购买
136 } 137 }
137 } 138 }
138 -  
139 $soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0; 139 $soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
140 $notForSale = $baseInfo['attribute'] == 2;//非卖品 140 $notForSale = $baseInfo['attribute'] == 2;//非卖品
141 $virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品 141 $virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品
@@ -783,9 +783,9 @@ class ItemModel @@ -783,9 +783,9 @@ class ItemModel
783 783
784 if (!empty($sizeInfo['productMaterialList'])) { 784 if (!empty($sizeInfo['productMaterialList'])) {
785 //商品材质[洗涤说明] 785 //商品材质[洗涤说明]
786 - $material['detail'] = array(); 786 + $material['materialDetail'] = array();
787 foreach ($sizeInfo['productMaterialList'] as $value) { 787 foreach ($sizeInfo['productMaterialList'] as $value) {
788 - $material['detail'][] = array( 788 + $material['materialDetail'][] = array(
789 'img' => $value['imageUrl'], 789 'img' => $value['imageUrl'],
790 'name' => $value['caption'], 790 'name' => $value['caption'],
791 'enName' => $value['encaption'], 791 'enName' => $value['encaption'],
@@ -870,7 +870,7 @@ class ItemModel @@ -870,7 +870,7 @@ class ItemModel
870 foreach ($baseInfo['goodsList'] as $pos => $value) { 870 foreach ($baseInfo['goodsList'] as $pos => $value) {
871 871
872 // 如果status为0,即skc下架时就跳过该商品 872 // 如果status为0,即skc下架时就跳过该商品
873 - if ($value['status'] === 0) { 873 + if ($value['status'] === 0 || empty($value['colorImage'])) {
874 continue; 874 continue;
875 } 875 }
876 if (isset($value['goodsImagesList'])) { 876 if (isset($value['goodsImagesList'])) {
@@ -1177,6 +1177,7 @@ class ItemModel @@ -1177,6 +1177,7 @@ class ItemModel
1177 $result['hasLimitedCode'] = true; 1177 $result['hasLimitedCode'] = true;
1178 $result['limitedCodeSoldOut'] = true; 1178 $result['limitedCodeSoldOut'] = true;
1179 $result['getLimitedCode'] = false; 1179 $result['getLimitedCode'] = false;
  1180 +
1180 break; 1181 break;
1181 case 6: // 开售前,即将开售(用户已领取限购码) 1182 case 6: // 开售前,即将开售(用户已领取限购码)
1182 $result['openSoon'] = true; 1183 $result['openSoon'] = true;
@@ -88,7 +88,7 @@ class IndexController extends WebAction @@ -88,7 +88,7 @@ class IndexController extends WebAction
88 $nodeContent = BrandData::getByNodeContent($node); 88 $nodeContent = BrandData::getByNodeContent($node);
89 89
90 if (isset($nodeContent['code']) && $nodeContent['code'] == 200) { 90 if (isset($nodeContent['code']) && $nodeContent['code'] == 200) {
91 - echo $nodeContent['data']; 91 + echo '<br>', $nodeContent['data'];
92 } 92 }
93 } 93 }
94 94
@@ -20,6 +20,7 @@ class ItemController extends WebAction @@ -20,6 +20,7 @@ class ItemController extends WebAction
20 } 20 }
21 $uid = $this->getUid(); 21 $uid = $this->getUid();
22 $vipLevel = -1; 22 $vipLevel = -1;
  23 + $sortNames = array();
23 if(!empty($this->_vip)) { 24 if(!empty($this->_vip)) {
24 $vipLevel = Helpers::getVipLevel($this->_vip); 25 $vipLevel = Helpers::getVipLevel($this->_vip);
25 } 26 }
@@ -28,11 +29,12 @@ class ItemController extends WebAction @@ -28,11 +29,12 @@ class ItemController extends WebAction
28 if(empty($productInfo)) { 29 if(empty($productInfo)) {
29 $this->error(); 30 $this->error();
30 } 31 }
31 - $sortNames = array();  
32 $navs = ItemModel::getSortNav($productInfo['goodsInfo']['smallSortId']); 32 $navs = ItemModel::getSortNav($productInfo['goodsInfo']['smallSortId']);
  33 + if(!empty($navs)) {
33 foreach($navs as $nav) { 34 foreach($navs as $nav) {
34 $sortNames[] = $nav['name']; 35 $sortNames[] = $nav['name'];
35 } 36 }
  37 + }
36 $seo = $this->getSeoByGoodsInfo($productInfo['goodsInfo'], $navs); 38 $seo = $this->getSeoByGoodsInfo($productInfo['goodsInfo'], $navs);
37 $this->setTitle($seo['title'], true, '|'); 39 $this->setTitle($seo['title'], true, '|');
38 $this->setKeywords($seo['keywords']); 40 $this->setKeywords($seo['keywords']);
@@ -83,11 +85,12 @@ class ItemController extends WebAction @@ -83,11 +85,12 @@ class ItemController extends WebAction
83 if(empty($productInfo)) { 85 if(empty($productInfo)) {
84 $this->error(); 86 $this->error();
85 } 87 }
86 -  
87 $navs = ItemModel::getSortNav($productInfo['goodsInfo']['smallSortId']); 88 $navs = ItemModel::getSortNav($productInfo['goodsInfo']['smallSortId']);
  89 + if(!empty($navs)) {
88 foreach($navs as $nav) { 90 foreach($navs as $nav) {
89 $sortNames[] = $nav['name']; 91 $sortNames[] = $nav['name'];
90 } 92 }
  93 + }
91 $seo = $this->getSeoByGoodsInfo($productInfo['goodsInfo'], $navs); 94 $seo = $this->getSeoByGoodsInfo($productInfo['goodsInfo'], $navs);
92 $this->setTitle($seo['title'], true, '|'); 95 $this->setTitle($seo['title'], true, '|');
93 $this->setKeywords($seo['keywords']); 96 $this->setKeywords($seo['keywords']);