|
@@ -52,8 +52,9 @@ class goods_commonControl extends mobileControl
|
|
if(empty($items)) {
|
|
if(empty($items)) {
|
|
$ret['comment'] = null;
|
|
$ret['comment'] = null;
|
|
} else {
|
|
} else {
|
|
- $comments = $this->format_comment($items);
|
|
|
|
|
|
+ $comments = $this->format_comment($items,3);
|
|
$ret['comments'] = $comments;
|
|
$ret['comments'] = $comments;
|
|
|
|
+ $ret['comment'] = $comments[0];
|
|
}
|
|
}
|
|
return self::outsuccess($ret,"shop/goods_detail");
|
|
return self::outsuccess($ret,"shop/goods_detail");
|
|
}
|
|
}
|
|
@@ -81,7 +82,7 @@ class goods_commonControl extends mobileControl
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
- private function format_comment($items)
|
|
|
|
|
|
+ private function format_comment($items,$cnt=0)
|
|
{
|
|
{
|
|
$comments = [];
|
|
$comments = [];
|
|
|
|
|
|
@@ -89,7 +90,7 @@ class goods_commonControl extends mobileControl
|
|
foreach ($items as $item)
|
|
foreach ($items as $item)
|
|
{
|
|
{
|
|
$i++;
|
|
$i++;
|
|
- if($i >=3) break;
|
|
|
|
|
|
+ if($cnt>0 && $i >=$cnt) break;
|
|
|
|
|
|
//$val = [];
|
|
//$val = [];
|
|
$val['geval_id'] = intval($item['geval_id']);
|
|
$val['geval_id'] = intval($item['geval_id']);
|