Authored by Rock Zhang

修改商品咨询列表数据获取接口为app.consult.li(便于和app.consult.like和app.consult.useful同步)

Code Review By Rock Zhang
... ... @@ -72,7 +72,7 @@ class DetailData
public static function consultList($productId, $pageNum, $pageSize)
{
$param = Yohobuy::param();
$param['method'] = 'h5.consult.li';
$param['method'] = 'app.consult.li';
$param['product_id'] = $productId;
$param['page'] = $pageNum;
$param['limit'] = $pageSize;
... ...
... ... @@ -561,16 +561,17 @@ class DetailModel
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
if (!empty($consultList)) {
if (isset($consultList['code']) && $consultList['code'] === 200) {
$consultList = $consultList['data']['list'];
$build = array();
foreach ($consultList as $value) {
$build['question'] = $value['ask'];
$build['time'] = $value['askTime'];
$build['time'] = $value['ask_time'];
$build['answer'] = $value['answer'];
$build['id'] = $value['id'];
$build['isLike'] = $value['isLike'];
$build['isLike'] = $value['is_like'] === 'Y';
$build['like'] = $value['like'];
$build['isUseful'] = $value['isUseful'];
$build['isUseful'] = $value['is_useful'] === 'Y';
$build['useful'] = $value['useful'];
$result[] = $build;
}
... ... @@ -626,7 +627,7 @@ class DetailModel
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::upvoteConsult($uid, $id);
$record = DetailData::usefulConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
... ...
... ... @@ -193,7 +193,7 @@ class DetailController extends AbstractAction
$productId = $this->get('product_id', 0);
$uid = $this->getUid();
$id = $this->post('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id, $productId);
$result = \Product\DetailModel::usefulConsult($uid, $id, $productId);
}
$this->echoJson($result);
... ...