最新下载
热门教程
- 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); } 剩下的就是通过在模板中用 |
|
调用了
相关文章
- OceanBase 联接算法概述 09-02
- OceanBase 联接顺序 09-02
- OceanBase 执行计划管理 09-02
- OceanBase 相关术语 09-02
- OceanBase SQL 调优常见问题 09-02
- OceanBase 下载 OceanBase 客户端(OBClient) 09-02