最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ecshop中首页显示商品购买过的次数方法
时间:2022-06-25 16:40:45 编辑:袖梨 来源:一聚教程网
这个需要修改一个程序文件 lib_goods.php
在文件末尾添加一个函数 function get_buy_sum($goods_id)
代码如下 | 复制代码 |
{ $sql = "select sum(goods_number) from " . $GLOBALS['ecs']->table('order_goods') . " AS g ,".$GLOBALS['ecs']->table('order_info') . " AS o WHERE o.order_id=g.order_id and g.goods_id = " . $goods_id . " and o.order_status=1 " ;//o.order_status=1 表示确认了的订单才算 return $GLOBALS['db']->getOne($sql); } 剩下的就是通过在模板中用 |
调用了
相关文章
- 碧蓝航线的里雅斯特期待的便当时间皮肤有什么 04-30
- 明日之后踏浪逐星服装展示攻略 04-30
- 深空之眼幽月塞勒涅刻印搭配核心思路 04-30
- 明日之后红杉茶会护卫队首领BOSS有哪些 04-30
- CF手游段位奖励汇总攻略 04-30
- 无期迷途5-13怎么走攻略 04-30