|
@@ -482,21 +482,24 @@ class ItemModel |
|
@@ -482,21 +482,24 @@ class ItemModel |
482
|
$commentList = ItemData::commentList($productId, $pageNum, $pageSize);
|
482
|
$commentList = ItemData::commentList($productId, $pageNum, $pageSize);
|
483
|
if (isset($commentList['code']) && $commentList['code'] === 200) {
|
483
|
if (isset($commentList['code']) && $commentList['code'] === 200) {
|
484
|
$build = array();
|
484
|
$build = array();
|
485
|
- foreach ($commentList['data'] as $value) {
|
|
|
486
|
- $headIco = ChannelConfig::$itemHeadDefaultImgIco;
|
|
|
487
|
- if(!empty($value['head_ico'])) {
|
|
|
488
|
- if(preg_match('@http://@', $value['head_ico'])) {
|
|
|
489
|
- $headIco = preg_replace('@http:\/\/img(.+)\.static\.yhbimg\.com\/headimg@', 'http://head.static.yhbimg.com/yhb-head/', $value['head_ico']);
|
485
|
+ foreach ($commentList['data']['pageResponse']['list'] as $value) {
|
|
|
486
|
+ $userInfo = $value['userInfo'];
|
|
|
487
|
+ $goods = $value['goods'];
|
|
|
488
|
+ $headIco = ChannelConfig::$itemHeadDefaultImgIco;//默认用户头像
|
|
|
489
|
+
|
|
|
490
|
+ if(!empty($userInfo['headIco'])) {
|
|
|
491
|
+ if(preg_match('@http://@', $userInfo['headIco'])) {
|
|
|
492
|
+ $headIco = preg_replace('@http:\/\/img(.+)\.static\.yhbimg\.com\/headimg@', 'http://head.static.yhbimg.com/yhb-head/', $userInfo['headIco']);
|
490
|
$headIco = Images::getImageUrl($headIco, 30, 30);
|
493
|
$headIco = Images::getImageUrl($headIco, 30, 30);
|
491
|
}
|
494
|
}
|
492
|
}
|
495
|
}
|
493
|
$build['avatar'] = $headIco;
|
496
|
$build['avatar'] = $headIco;
|
494
|
- $build['userName'] = $value['nickname'];
|
|
|
495
|
- $build['color'] = $value['color_name'];
|
|
|
496
|
- $build['size'] = $value['size_name'];
|
497
|
+ $build['userName'] = $userInfo['nickname'];
|
|
|
498
|
+ $build['color'] = $goods['color_name'];
|
|
|
499
|
+ $build['size'] = $goods['size_name'];
|
497
|
$build['comment'] = isset($value['content']) ? $value['content'] : '';
|
500
|
$build['comment'] = isset($value['content']) ? $value['content'] : '';
|
498
|
- $build['date'] = $value['create_time'];
|
|
|
499
|
- $build['total'] = $value['total'];
|
501
|
+ $build['date'] = date('Y-m-d H:i:s', $value['createTime']);
|
|
|
502
|
+ $build['total'] = $commentList['data']['pageResponse']['totalCount'];
|
500
|
$result[] = $build;
|
503
|
$result[] = $build;
|
501
|
}
|
504
|
}
|
502
|
}
|
505
|
}
|