Authored by 郭成尧

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

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