
首先找到程序文件 lib_goods.php,在文件末尾添加一个函数:
[code lang="php"]
function get_evaluation_sum($goods_id)
{
$sql = "SELECT count(*) FROM " . $GLOBALS['ecs']->table('comment') . " WHERE status=1 and comment_type =0 and id_value =".$goods_id ;//status=1表示通过了的评论才算 comment_type =0表示针对商品的评价
return $GLOBALS['db...