ECSHOP首页调用显示最新商品评论
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
ECSHOP首页显示最新评论,首页调用商品评论新建立一个 index_comments.lbi 库文件 然后在index.dwt 要显示的位置调用: index_comments.lbi 内容为: table('comment') . ' AS a,'. $GLOBALS['ecs']->table('goods') .'AS b WHERE a.status = 1 AND a.parent_id = 0 and LENGTH(a.content)>0 and a.comment_type=0 and a.id_value=b.goods_id '. ' ORDER BY a.add_time DESC'; if ($num > 0) { $sql .= ' LIMIT ' . $num; } //echo $sql; $res = $GLOBALS['db']->getAll($sql); $comments = array(); foreach ($res AS $idx => $row) { $comments[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']); $comments[$idx]['content'] = $row['content']; $comments[$idx]['id_value'] = $row['id_value']; $comments[$idx]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $comments[$idx]['goods_name'] = $row['goods_name']; } return $comments; } } ?> assign('my_comments',get_comments(10)); // 数据条数 ?>
- {$comments.add_time}
{$comments.content|truncate:10:""}
最近更新
常用插件
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...