本文整理自网络,侵删。
我直接写上操作步骤吧,看下思路,相信大家也会了
第一步:
在includes/lib_goods.php里面构建自定义函数
代码如下:
/**
* 获取最近评论
*
* @return array
*/
function get_latest_comment($limit_num)
{
$sql = "SELECT c.content,c.add_time,g.goods_id,g.goods_name FROM ".$GLOBALS['ecs']->table('comment')." AS c
LEFT JOIN ".$GLOBALS['ecs']->table('goods')." AS g on c.id_value=g.goods_id
WHERE c.status=1
LIMIT ".$limit_num;
$res = $GLOBALS['db']->getAll($sql);
return $res;
}
/**
* 获取最近评论
*
* @return array
*/
function get_latest_comment($limit_num)
{
$sql = "SELECT c.content,c.add_time,g.goods_id,g.goods_name FROM ".$GLOBALS['ecs']->table('comment')." AS c
LEFT JOIN ".$GLOBALS['ecs']->table('goods')." AS g on c.id_value=g.goods_id
WHERE c.status=1
LIMIT ".$limit_num;
$res = $GLOBALS['db']->getAll($sql);
return $res;
}
第二步:
相关阅读 >>
discuz有关问题解决办法汇总(can not write to cache files)
更多相关阅读请进入《Discuz论坛》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。