Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

EcShop教程:显示某商品销售累计效果的实现代码

EcShop教程:显示某商品销售累计效果的实现代码,首先在代码里面增加调用某商品的累计售出函数,并在代码位置增加调用代码

修改includes/lib_insert.php文件,增加一个函数

复制代码代码如下:

** 
* 调用某商品的累积售出 
*/ 
function insert_goods_sells($arr) 
{ 
$sql = 'SELECT SUM(goods_number) AS number ' . 
' FROM ' . $GLOBALS['ecs']->table('order_goods') ." AS og , " . $GLOBALS['ecs']->table('order_info') ." AS o ". 
" WHERE og.order_id = o.order_id and og.goods_id=".$arr['goods_id']; 
$row = $GLOBALS['db']->GetRow($sql); 
if ($row) 
{ 
$number = intval($row['number']); 
} 
else 
{ 
$number = 0; 
} 
return $number; 
} 

修改模板下goods.dwt文件

增加一行代码

<strong>累计售出:</strong>{insert name='goods_sells' goods_id=$id}{$goods.measure_unit}
温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

EcShop教程安装遇到安装数据失败的解决方法

2015-12-2 9:00:00

编程技巧

织梦教程DedeCMS列表页调用TAG标签并带上链接的实现方法

2015-12-4 9:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索