|
@@ -449,6 +449,11 @@ class DetailModel |
|
@@ -449,6 +449,11 @@ class DetailModel |
449
|
|
449
|
|
450
|
/**
|
450
|
/**
|
451
|
* 获取评价列表
|
451
|
* 获取评价列表
|
|
|
452
|
+ *
|
|
|
453
|
+ * @param int $productId 产品ID
|
|
|
454
|
+ * @param int $pageNum 页码数
|
|
|
455
|
+ * @param int $pageSize 每页显示个数
|
|
|
456
|
+ * @return array
|
452
|
*/
|
457
|
*/
|
453
|
public static function getComments($productId, $pageNum = 1, $pageSize = 300)
|
458
|
public static function getComments($productId, $pageNum = 1, $pageSize = 300)
|
454
|
{
|
459
|
{
|
|
@@ -456,13 +461,13 @@ class DetailModel |
|
@@ -456,13 +461,13 @@ class DetailModel |
456
|
|
461
|
|
457
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
462
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
458
|
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
|
463
|
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
|
459
|
- if (!empty($commentList)) {
|
464
|
+ if (!empty($commentList['data'])) {
|
460
|
$build = array();
|
465
|
$build = array();
|
461
|
- foreach ($commentList as $value) {
|
|
|
462
|
- $build['userName'] = '';
|
|
|
463
|
- $build['desc'] = '';
|
|
|
464
|
- $build['content'] = '';
|
|
|
465
|
- $build['time'] = '';
|
466
|
+ foreach ($commentList['data'] as $value) {
|
|
|
467
|
+ $build['userName'] = $value['nickname'];
|
|
|
468
|
+ $build['desc'] = $value['color_name'] . '/' . $value['size_name'];
|
|
|
469
|
+ $build['content'] = $value['content'];
|
|
|
470
|
+ $build['time'] = $value['create_time'];
|
466
|
$result[] = $build;
|
471
|
$result[] = $build;
|
467
|
}
|
472
|
}
|
468
|
}
|
473
|
}
|