LYECS 2.0 BUG修复

【重要】积分赠送BUG,请尽快修复,如果开启积分赠送该BUG会导至积分计算错误

LYECS,LYECS+商城系统,多用户商城系统,开源商城系统 发布日期:2015-09-28   作者:老杨

积分赠送BUG,请尽快修复,如果开启积分赠送该BUG会导至积分计算错误


找到includes/lib_order.php

function get_give_integral()
{
        $sql = "SELECT SUM(c.goods_number * IF(g.give_integral > -1, g.give_integral, c.goods_price))" .
                "FROM " . $GLOBALS['ecs']->table('cart') . " AS c, " .
                          $GLOBALS['ecs']->table('goods') . " AS g " .
                "WHERE c.goods_id = g.goods_id " .
                "AND c.session_id = '" . SESS_ID . "' " .
                "AND c.goods_id > 0 " .
                "AND c.parent_id = 0 " .
                "AND c.rec_type = 0 " .
                "AND c.is_gift = 0";

        return intval($GLOBALS['db']->getOne($sql));
}


替换为:

function get_give_integral()
{
        $sql = "SELECT SUM(c.goods_number * IF(g.give_integral > -1, g.give_integral, c.goods_price))" .
                "FROM " . $GLOBALS['ecs']->table('cart') . " AS c, " .
                          $GLOBALS['ecs']->table('goods') . " AS g " .
                "WHERE c.goods_id = g.goods_id " .
                "AND c.session_id = '" . SESS_ID . "' " .
                "AND c.goods_id > 0 " .
                "AND c.parent_id = 0 " .
                "AND c.rec_type = 0 " ." AND rec_id  " .db_create_in($_SESSION['cart_rec_ids']).
                "AND c.is_gift = 0";

        return intval($GLOBALS['db']->getOne($sql));
}

热门文章

分类标签