|
@@ -561,16 +561,17 @@ class DetailModel |
|
@@ -561,16 +561,17 @@ class DetailModel |
561
|
|
561
|
|
562
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
562
|
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
|
563
|
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
|
563
|
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
|
564
|
- if (!empty($consultList)) {
|
564
|
+ if (isset($consultList['code']) && $consultList['code'] === 200) {
|
|
|
565
|
+ $consultList = $consultList['data']['list'];
|
565
|
$build = array();
|
566
|
$build = array();
|
566
|
foreach ($consultList as $value) {
|
567
|
foreach ($consultList as $value) {
|
567
|
$build['question'] = $value['ask'];
|
568
|
$build['question'] = $value['ask'];
|
568
|
- $build['time'] = $value['askTime'];
|
569
|
+ $build['time'] = $value['ask_time'];
|
569
|
$build['answer'] = $value['answer'];
|
570
|
$build['answer'] = $value['answer'];
|
570
|
$build['id'] = $value['id'];
|
571
|
$build['id'] = $value['id'];
|
571
|
- $build['isLike'] = $value['isLike'];
|
572
|
+ $build['isLike'] = $value['is_like'] === 'Y';
|
572
|
$build['like'] = $value['like'];
|
573
|
$build['like'] = $value['like'];
|
573
|
- $build['isUseful'] = $value['isUseful'];
|
574
|
+ $build['isUseful'] = $value['is_useful'] === 'Y';
|
574
|
$build['useful'] = $value['useful'];
|
575
|
$build['useful'] = $value['useful'];
|
575
|
$result[] = $build;
|
576
|
$result[] = $build;
|
576
|
}
|
577
|
}
|
|
@@ -626,7 +627,7 @@ class DetailModel |
|
@@ -626,7 +627,7 @@ class DetailModel |
626
|
$result = array('code' => 400, 'message' => '出错啦~');
|
627
|
$result = array('code' => 400, 'message' => '出错啦~');
|
627
|
|
628
|
|
628
|
do {
|
629
|
do {
|
629
|
- $record = DetailData::upvoteConsult($uid, $id);
|
630
|
+ $record = DetailData::usefulConsult($uid, $id);
|
630
|
|
631
|
|
631
|
if (empty($uid)) {
|
632
|
if (empty($uid)) {
|
632
|
$result['code'] = 401;
|
633
|
$result['code'] = 401;
|