这个需要修改一个程序文件 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); } 剩下的就是通过在模板中用 |
调用了
时间: 2025-01-21 04:42:00