Authored by uedxwg

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -73,6 +73,7 @@ class DetailData
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ... @@ -86,7 +87,15 @@ class DetailData
*/
public static function commentList($productId, $pageNum, $pageSize)
{
// 暂未提供提口
$param = Yohobuy::param();
$param['method'] = 'app.comment.li';
$param['product_id'] = $productId;
$param['page'] = $pageNum;
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ...
... ... @@ -449,6 +449,11 @@ class DetailModel
/**
* 获取评价列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function getComments($productId, $pageNum = 1, $pageSize = 300)
{
... ... @@ -456,13 +461,13 @@ class DetailModel
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
if (!empty($commentList)) {
if (!empty($commentList['data'])) {
$build = array();
foreach ($commentList as $value) {
$build['userName'] = '';
$build['desc'] = '';
$build['content'] = '';
$build['time'] = '';
foreach ($commentList['data'] as $value) {
$build['userName'] = $value['nickname'];
$build['desc'] = $value['color_name'] . '/' . $value['size_name'];
$build['content'] = $value['content'];
$build['time'] = $value['create_time'];
$result[] = $build;
}
}
... ...
... ... @@ -90,7 +90,7 @@ class DetailController extends AbstractAction
'goodsCommentsPage' => true,
'pageFooter' => true,
'comments' => array(
'list' => \Product\DetailModel::getConsults($productId),
'list' => \Product\DetailModel::getComments($productId),
),
);
... ...