- 时间:2019-01-31 02:15 编辑:2KB 来源:2KB.COM 阅读:324
- 扫一扫,手机访问
- 分享
-
扫描二维码,分享到微信
打开微信
使用"扫一扫"
再点击微信界面右上角三个点标志
分享到微信朋友和朋友圈。
摘要:
方案如下:
修改 includes/lib_insert.php 文件,
增加一个函数
复制代码代码如下:
/**
* 调用某商品的累积售出
*/
function insert_goods_sells($arr)
方案如下: 修改 includes/lib_insert.php 文件, 增加一个函数 复制代码代码如下: /** * 调用某商品的累积售出 */ function insert_goods_sells($arr) { $sql = &#39;SELECT SUM(goods_number) AS number &#39; . &#39; FROM &#39; . $GLOBALS[&#39;ecs&#39;]->table(&#39;order_goods&#39;) ." AS og , " . $GLOBALS[&#39;ecs&#39;]->table(&#39;order_info&#39;) ." AS o ". " WHERE og.order_id = o.order_id and og.goods_id=".$arr[&#39;goods_id&#39;]; $row = $GLOBALS[&#39;db&#39;]->GetRow($sql); if ($row) { $number = intval($row[&#39;number&#39;]); } else { $number = 0; } return $number; } 修改模板下goods.dwt文件 增加一行代码 <strong>累计售出:</strong>{insert name=&#39;goods_sells&#39; goods_id=$id}{$goods.measure_unit}

2KB项目(www.2kb.com,源码交易平台),提供担保交易、源码交易、虚拟商品、在家创业、在线创业、任务交易、网站设计、软件设计、网络兼职、站长交易、域名交易、链接买卖、网站交易、广告买卖、站长培训、建站美工等服务