在线建站培训
?客服
?搜索
您的位置: 维尼斯老虎机 cms韦德老虎机 ecshop韦德老虎机 查看内容

ECShop修改商品的近期购买记录显示所有

2017-6-25 08:17 | 发布者: moke | 栏目:ecshop韦德老虎机

直接上修改方法,找到文件:includes/lib_insert.php

找到这句话:

[代码]php代码:

$sql = 'SELECT u.user_name, og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .           'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .           'WHERE oi.order_id = og.order_id AND ' . time() . ' - oi.add_time < 5592000 AND og.goods_id = ' . $arr['id'] . ' ORDER BY oi.add_time DESC LIMIT 50';    $bought_notes = $GLOBALS['db']->getAll($sql);

将其修改为:

[代码]php代码:

$sql = 'SELECT u.user_name, og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .           'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .           'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $arr['id'] . ' ORDER BY oi.add_time DESC LIMIT 50';    $bought_notes = $GLOBALS['db']->getAll($sql);

再找到下面这句:

[代码]php代码:

$sql = 'SELECT count(*) ' .           'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .           'WHERE oi.order_id = og.order_id AND ' . time() . ' - oi.add_time < 5592000 AND og.goods_id = ' . $arr['id'];    $count = $GLOBALS['db']->getOne($sql);

将其修改为:

[代码]php代码:

$sql = 'SELECT count(*) ' .           'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .           'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $arr['id'];    $count = $GLOBALS['db']->getOne($sql);

找到文件:includes/goods.php

找到这段话:

[代码]php代码:

$sql = 'SELECT u.user_name, og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .               'FROM ' . $ecs->table('order_info') . ' AS oi LEFT JOIN ' . $ecs->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $ecs->table('order_goods') . ' AS og ' .               'WHERE oi.order_id = og.order_id AND ' . time() . ' - oi.add_time < 2592000 AND og.goods_id = ' . $goods_id . ' ORDER BY oi.add_time DESC LIMIT ' . (($page > 1) ? ($page-1) : 0) * 50 . ',50';

将其修改为:

[代码]php代码:

$sql = 'SELECT u.user_name, og.goods_number, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .               'FROM ' . $ecs->table('order_info') . ' AS oi LEFT JOIN ' . $ecs->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $ecs->table('order_goods') . ' AS og ' .               'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $goods_id . ' ORDER BY oi.add_time DESC LIMIT ' . (($page > 1) ? ($page-1) : 0) * 50 . ',50';

再往下找到这段:

[代码]php代码:

$sql = 'SELECT count(*) ' .               'FROM ' . $ecs->table('order_info') . ' AS oi LEFT JOIN ' . $ecs->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $ecs->table('order_goods') . ' AS og ' .               'WHERE oi.order_id = og.order_id AND ' . time() . ' - oi.add_time < 2592000 AND og.goods_id = ' . $goods_id;

将其修改为:

[代码]php代码:

$sql = 'SELECT count(*) ' .               'FROM ' . $ecs->table('order_info') . ' AS oi LEFT JOIN ' . $ecs->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $ecs->table('order_goods') . ' AS og ' .               'WHERE oi.order_id = og.order_id AND og.goods_id = ' . $goods_id;

最后更新缓存即可。





维尼斯老虎机温馨提示:如果你正在寻找优秀的ecshop维尼斯老虎机,那你可以到维尼斯老虎机的 ecshop维尼斯老虎机 频道看看,相信一定有你喜欢的!

最新分享资源

最新评论

验证码 换一个

维尼斯老虎机,韦德老虎机,韦德1946老虎机

百度360搜索搜狗搜索