LYECS 2.0 BUG修复

解决在开启短信的情况下,因为执行短信时产生的延迟,而导致用户快速点击提交时出现重复扣余额、空订单的情况

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

解决在开启短信的情况下,因为执行短信时产生的延迟,而导致用户快速点击提交时出现重复扣余额、空订单的情况



1、flow.php找到:

你有可能会找到两处这个地方,这里先改前面有这个的那个

        $order['pay_status'] = PS_PAYED;
        $order['pay_time'] = gmtime();

        /* 如果需要,发送老杨定制短信 www.lyecs.com 老杨ecshop版权所有*/
        if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != ''  && $_LYCFG['mobi_user_pay'] == '1' && $order['mobile'] !='' )
        {
            send_mobi_info($order['mobile'],'user_pay',$order['order_sn']);
        }
        /* 如果需要,发送老杨定制短信-商家 */
        if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != '' && $_LYCFG['mobi_shop_mobi'] != ''   && $_LYCFG['mobi_shop_pay'] == '1' && $order['mobile'] !='' )
        {
            $mcontent = sprintf($GLOBALS['_LYCFG']['mobile_text_shop_pay'], $order['order_sn'],$surplus);
            send_mobi_info($_LYCFG['mobi_shop_mobi'],'default',$mcontent);
        }


    将红字部份将其删除

2、找到
    /* 跳转 */
    $result['error']=0;
    $result['content']="余额支付成功!";
    die($json->encode($result));

在其前面(注意,是前面)添加以下代码:



    if ($order['order_amount'] == 0)
    {
        /* 如果需要,发送老杨定制短信 www.lyecs.com 老杨ecshop版权所有*/
        if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != ''  && $_LYCFG['mobi_user_pay'] == '1' && $order['mobile'] !='' )
        {
            send_mobi_info($order['mobile'],'user_pay',$order['order_sn']);
        }
        /* 如果需要,发送老杨定制短信-商家 */
        if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != '' && $_LYCFG['mobi_shop_mobi'] != ''   && $_LYCFG['mobi_shop_pay'] == '1' && $order['mobile'] !='' )
        {
            $mcontent = sprintf($GLOBALS['_LYCFG']['mobile_text_shop_pay'], $order['order_sn'],$surplus);
            send_mobi_info($_LYCFG['mobi_shop_mobi'],'default',$mcontent);
        }

    }

3、同文件找到以下代码:


    /* 给商家发邮件 */
    /* 增加是否给客服发送邮件选项 */
    if ($_CFG['send_service_email'] && $_CFG['service_email'] != '')
    {
        $tpl = get_mail_template('remind_of_new_order');
        $smarty->assign('order', $order);
        $smarty->assign('goods_list', $cart_goods);
        $smarty->assign('shop_name', $_CFG['shop_name']);
        $smarty->assign('send_date', date($_CFG['time_format']));
        $content = $smarty->fetch('str:' . $tpl['template_content']);
        send_mail($_CFG['shop_name'], $_CFG['service_email'], $tpl['template_subject'], $content, $tpl['is_html']);
    }
    /* 发送邮件 */
    if ($_LYCFG['send_confirm_email'] == '1')
    {
        $template_subject='订单收到通知';
        $content ='您的订单:'.$order['order_sn'].'已收到,请及时完成付款,感谢您的惠顾!查看订单';
        $email=$_SESSION['email'] ? $_SESSION['email'] : $order['email'];
        if($email)send_mail($order['consignee'], $order['email'], $template_subject.'_'.$_CFG['shop_name'], $content,1);
    }

    /* 如果需要,发短信 */
    if ($_CFG['sms_order_placed'] == '1' && $_CFG['sms_shop_mobile'] != '')
    {
        include_once('includes/cls_sms.php');
        $sms = new sms();
        $msg = $order['pay_status'] == PS_UNPAYED ?
            $_LANG['order_placed_sms'] : $_LANG['order_placed_sms'] . '[' . $_LANG['sms_paid'] . ']';
        $sms->send($_CFG['sms_shop_mobile'], sprintf($msg, $order['consignee'], $order['tel']),'', 13,1);
    }
    /* 如果需要,发送老杨定制短信 www.lyecs.com 老杨ecshop版权所有*/
    if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != ''  && $_LYCFG['mobi_user_order'] == '1' && $order['mobile'] !='' )
    {
        send_mobi_info($order['mobile'],'user_order',$order['order_sn']);
    }
    /* 如果需要,发送老杨定制短信-商家 */
    if ($_LYCFG['mobi_user'] != ''  && $_LYCFG['mobi_password'] != '' && $_LYCFG['mobi_shop_mobi'] != ''   && $_LYCFG['mobi_shop_order'] == '1' && $order['mobile'] !='' )
    {
        $mcontent = sprintf($GLOBALS['_LYCFG']['mobile_text_shop_order'], $order['order_sn'],$order['order_amount']);
        send_mobi_info($_LYCFG['mobi_shop_mobi'],'default',$mcontent);
    }


将其删除并重制到以下代码的前面(记住是前面)

ecs_header("Location: flow.php?step=order_pay&id=".$new_order_id."\n");


4、mobile/flow.php重复操作

热门文章

分类标签