为什么我把下面这段代码加在search.php里会出现这种问题?

2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家



$arr[$row['goods_id']]['review'];
$count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " where comment_type=0 and id_value ='$goods_id'");
$arr[$row['goods_id']]['review_count']= $count;



$arr[$row['goods_id']]['goods_img']= get_image_path($row['goods_id'], $row['goods_img']);
$arr[$row['goods_id']]['url']= build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);


加在这后面



我想在搜索结果页给商品加上评论次数,但是会跟翻页的起冲突,就是要么页码显示正确,要么就只有评论次数,页码的不显示,我想count都是读取页码里的信息,所以起冲突了,这要怎么解决?