Authored by 郭成尧

线上BUG修复商品详情页常见问题恢复

1 <ul id="nav-tab" class="nav-tab clearfix"> 1 <ul id="nav-tab" class="nav-tab clearfix">
2 <li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li> 2 <li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>
  3 + {{#if commonConsults}}
  4 + <li class="consult-nav tap-hightlight">常见问题</li>
  5 + {{^}}
3 <li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li> 6 <li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
  7 + {{/if}}
4 </ul> 8 </ul>
5 <div id="feedback-content" > 9 <div id="feedback-content" >
6 <div class="comment-content content "> 10 <div class="comment-content content ">
@@ -126,7 +126,7 @@ class DetailModel @@ -126,7 +126,7 @@ class DetailModel
126 126
127 // 商品咨询 127 // 商品咨询
128 $result['feedbacks']['consultsNum'] = 0; 128 $result['feedbacks']['consultsNum'] = 0;
129 - if (!empty($baseInfo['consultBoWrapper'])) { 129 + if (!empty($baseInfo['consultBoWrapper']) && $baseInfo['consultBoWrapper']['consultTotal'] !== 0) {
130 $result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal']; 130 $result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal'];
131 $result['feedbacks']['consults'] = array(); 131 $result['feedbacks']['consults'] = array();
132 $build = array(); 132 $build = array();
@@ -139,7 +139,12 @@ class DetailModel @@ -139,7 +139,12 @@ class DetailModel
139 $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum'])); 139 $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
140 } // 暂无咨询 140 } // 暂无咨询
141 else { 141 else {
142 - $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId)); 142 + // tar modified 201606141155 常見問題恢復
  143 + $result['feedbacks']['consults'] = array_slice(self::getCommonConsults()['commonConsults'], 0, 2);
  144 + $result['feedbacks']['consultsNum'] = 2; // 数字无意义,兼容原来的前端模板代码使用,不能为 0
  145 + $result['feedbacks']['commonConsults'] = true; // 用来标记是否是常见问题的
  146 + $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
  147 +// $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
143 } 148 }
144 149
145 // 商品评价 150 // 商品评价