解决ecshop订单修改价格后无法再次付款问题
2016-09-07 22:02 来源:www.chinab4c.com 作者:ecshop专家
ecshop网店系统客户请求客服在后台修正了订单金额,客户再次付款时就是报错了,提示如下
该疑问的解决办法是找到admin/order.php中的以下代码 /** * 更新订单对应的 pay_log * 假如未付出,修正付出金额;不然,生成新的付出log * @param int $order_id 订单id */ function update_pay_log($order_id) { $order_id = intval($order_id); if ($order_id > 0) { $sql = "SELECT order_amount FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '$order_id'"; $order_amount = $GLOBALS['db']->getOne($sql); if (!is_null($order_amount)) { $sql = "SELECT log_id FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE order_id = '$order_id'" . " AND order_type = '" . PAY_ORDER . "'" . " AND is_paid = 0"; $log_id = intval($GLOBALS['db']->getOne($sql)); if ($log_id > 0) { /* 未付款,更新付出金额 */ $sql = "UPDATE " . $GLOBALS['ecs']->table('pay_log') . " SET order_amount = '$order_amount' " . "WHERE log_id = '$log_id' LIMIT 1"; } else { /* 已付款,生成新的pay_log */ $sql = "INSERT INTO " . $GLOBALS['ecs']->table('pay_log') . " (order_id, order_amount, order_type, is_paid)" . "VALUES('$order_id', '$order_amount', '" . PAY_ORDER . "', 0)"; } $GLOBALS['db']->query($sql); } } } 用以下代码将其覆盖 /** * 更新订单对应的 pay_log * 假如未付出,修正付出金额;不然,生成新的付出log * @param int $order_id 订单id */ function update_pay_log($order_id) { $order_id = intval($order_id); if ($order_id > 0) { $sql = "SELECT order_amount FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '$order_id'"; $order_amount = $GLOBALS['db']->getOne($sql); if (!is_null($order_amount)) { $sql = "SELECT log_id, order_amount FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE order_id = '$order_id'" . " AND order_type = '" . PAY_ORDER . "'" . " AND is_paid = 0"; $log_info =$GLOBALS['db']->GetRow($sql); if ($log_info && $log_info['order_amount'] == $order_amount) { $log_id = intval($log_info['log_id']); /* 未付款,更新付出金额 */ $sql = "UPDATE " . $GLOBALS['ecs']->table('pay_log') . " SET order_amount = '$order_amount' " . "WHERE log_id = '$log_id' LIMIT 1"; } else { /* 已付款,生成新的pay_log */ $sql = "INSERT INTO " . $GLOBALS['ecs']->table('pay_log') . " (order_id, order_amount, order_type, is_paid)" . "VALUES('$order_id', '$order_amount', '" . PAY_ORDER . "', 0)"; } $GLOBALS['db']->query($sql); } } } 找到includes/lib_clips.php的get_paylog_id函数,修正成 /** * 获得前次未付出的pay_lig_id * * @access public * @param array $surplus_id 余额记录的ID * @param array $pay_type 付出的类型:预付款/订单付出 * * @return int */ function get_paylog_id($surplus_id, $pay_type = PAY_SURPLUS) { $sql = 'SELECT log_id FROM' .$GLOBALS['ecs']->table('pay_log'). " WHERE order_id = '$surplus_id' AND order_type = '$pay_type' AND is_paid = 0 order by log_id desc "; return $GLOBALS['db']->getOne($sql); }
今后客户在后台怎么调整都可以付款了, |
最近更新
常用插件
- ecshop2.7.2生成虚拟订单2.
以前我们开发过ecshop下的虚拟订单,就是客户在访问的时候,会自动生...
- ecshop二次开发商品购买增
图片1香...
- ecshop2.7.1邮件发送插件
ecshop2.7.1邮件发送插件:该插件主要的开发思想是源于ecshop短信发送系统...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
- ecshop最小购买数量控制插
ecshop最小购买数量控制插件,这个插件主要是为我们提供一个十分方便...
ecshop热门问答
ecshop热门资料
ecshopGCOGO
ecshop多用户商城
ecshopwav
ecshop位数
ecshop处变
ecshop配件转换成普通商品
ecshopsession时间
ecshop2.7.1插件
ecshop深圳创意馆
ecshopAdSense
ecshopedm
ecshop转回
ecshop忽悠
ecshop商品推荐
ecshopSun
ecshop显示方式
ecshop广告位
ecshop借口
ecshop网站出错
ecshopECSHOP程序
ecshop登陆冲突
ecshop语言包
ecshop疑难
ecshop美观
ecshop整合问题
ecshopPHP168
ecshop总额
ecshopEC二次开发
ecshopjson类使用
ecshop答案