当前位置: 首页>>代码示例>>PHP>>正文


PHP get_virtual_goods函数代码示例

本文整理汇总了PHP中get_virtual_goods函数的典型用法代码示例。如果您正苦于以下问题:PHP get_virtual_goods函数的具体用法?PHP get_virtual_goods怎么用?PHP get_virtual_goods使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_virtual_goods函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_order_detail

/**
 *  获取指订单的详情
 *
 * @access  public
 * @param   int         $order_id       订单ID
 * @param   int         $user_id        用户ID
 *
 * @return   arr        $order          订单所有信息的数组
 */
function get_order_detail($order_id, $user_id = 0)
{
    include_once ROOT_PATH . 'includes/lib_order.php';
    $order_id = intval($order_id);
    if ($order_id <= 0) {
        $GLOBALS['err']->add(L('invalid_order_id'));
        return false;
    }
    $order = order_info($order_id);
    //检查订单是否属于该用户
    if ($user_id > 0 && $user_id != $order['user_id']) {
        $GLOBALS['err']->add(L('no_priv'));
        return false;
    }
    /* 对发货号处理 */
    if (!empty($order['invoice_no'])) {
        $shipping_code = $GLOBALS['db']->GetOne("SELECT shipping_code FROM " . $GLOBALS['ecs']->table('shipping') . " WHERE shipping_id = '{$order['shipping_id']}'");
        $plugin = ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php';
        if (file_exists($plugin)) {
            include_once $plugin;
            $shipping = new $shipping_code();
            $order['invoice_no'] = $shipping->query($order['invoice_no']);
        }
    }
    /* 只有未确认才允许用户修改订单地址 */
    if ($order['order_status'] == OS_UNCONFIRMED) {
        $order['allow_update_address'] = 1;
        //允许修改收货地址
    } else {
        $order['allow_update_address'] = 0;
    }
    /* 获取订单中实体商品数量 */
    $order['exist_real_goods'] = exist_real_goods($order_id);
    /* 如果是未付款状态,生成支付按钮 */
    if ($order['pay_status'] == PS_UNPAYED && ($order['order_status'] == OS_UNCONFIRMED || $order['order_status'] == OS_CONFIRMED)) {
        /*
         * 在线支付按钮
         */
        //支付方式信息
        $payment_info = array();
        $payment_info = payment_info($order['pay_id']);
        //无效支付方式
        if ($payment_info === false) {
            $order['pay_online'] = '';
        } else {
            //取得支付信息,生成支付代码
            $payment = unserialize_config($payment_info['pay_config']);
            //获取需要支付的log_id
            $order['log_id'] = get_paylog_id($order['order_id'], $pay_type = PAY_ORDER);
            $order['user_name'] = $_SESSION['user_name'];
            $order['pay_desc'] = $payment_info['pay_desc'];
            /* 调用相应的支付方式文件 */
            include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
            /* 取得在线支付方式的支付按钮 */
            $pay_obj = new $payment_info['pay_code']();
            $order['pay_online'] = $pay_obj->get_code($order, $payment);
        }
    } else {
        $order['pay_online'] = '';
    }
    /* 无配送时的处理 */
    $order['shipping_id'] == -1 and $order['shipping_name'] = L('shipping_not_need');
    /* 其他信息初始化 */
    $order['how_oos_name'] = $order['how_oos'];
    $order['how_surplus_name'] = $order['how_surplus'];
    /* 虚拟商品付款后处理 */
    if ($order['pay_status'] != PS_UNPAYED) {
        /* 取得已发货的虚拟商品信息 */
        $virtual_goods = get_virtual_goods($order_id, true);
        $virtual_card = array();
        foreach ($virtual_goods as $code => $goods_list) {
            /* 只处理虚拟卡 */
            if ($code == 'virtual_card') {
                foreach ($goods_list as $goods) {
                    if ($info = virtual_card_result($order['order_sn'], $goods)) {
                        $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                    }
                }
            }
            /* 处理超值礼包里面的虚拟卡 */
            if ($code == 'package_buy') {
                foreach ($goods_list as $goods) {
                    $sql = 'SELECT g.goods_id FROM ' . $GLOBALS['ecs']->table('package_goods') . ' AS pg, ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "WHERE pg.goods_id = g.goods_id AND pg.package_id = '" . $goods['goods_id'] . "' AND extension_code = 'virtual_card'";
                    $vcard_arr = $GLOBALS['db']->getAll($sql);
                    foreach ($vcard_arr as $val) {
                        if ($info = virtual_card_result($order['order_sn'], $val)) {
                            $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                        }
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:connwap135,项目名称:ectouch,代码行数:101,代码来源:transaction_helper.php

示例2: order_paid

/**
 * 修改订单的支付状态
 *
 * @access  public
 * @param   string  $log_id     支付编号
 * @param   integer $pay_status 状态
 * @param   string  $note       备注
 * @return  void
 */
function order_paid($log_id, $pay_status = PS_PAYED, $note = '')
{
    /* 取得支付编号 */
    $log_id = intval($log_id);
    if ($log_id > 0) {
        /* 取得要修改的支付记录信息 */
        $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE log_id = '{$log_id}'";
        $pay_log = $GLOBALS['db']->getRow($sql);
        if ($pay_log && $pay_log['is_paid'] == 0) {
            /* 修改此次支付操作的状态为已付款 */
            $sql = 'UPDATE ' . $GLOBALS['ecs']->table('pay_log') . " SET is_paid = '1' WHERE log_id = '{$log_id}'";
            $GLOBALS['db']->query($sql);
            /* 根据记录类型做相应处理 */
            if ($pay_log['order_type'] == PAY_ORDER) {
                /* 取得订单信息 */
                $sql = 'SELECT order_id, order_sn, consignee, address, tel, shipping_id ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
                $order = $GLOBALS['db']->getRow($sql);
                $order_id = $order['order_id'];
                $order_sn = $order['order_sn'];
                /* 修改订单状态为已付款 */
                $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET order_status = '" . OS_CONFIRMED . "', " . " confirm_time = '" . gmtime() . "', " . " pay_status = '{$pay_status}', " . " pay_time = '" . gmtime() . "', " . " money_paid = order_amount," . " order_amount = 0 " . "WHERE order_id = '{$order_id}'";
                $GLOBALS['db']->query($sql);
                /* 记录订单操作记录 */
                order_action($order_sn, OS_CONFIRMED, SS_UNSHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                /* 如果需要,发短信 */
                if ($GLOBALS['_CFG']['sms_order_payed'] == '1' && $GLOBALS['_CFG']['sms_shop_mobile'] != '') {
                    include_once ROOT_PATH . 'includes/cls_sms.php';
                    $sms = new sms();
                    $sms->send($GLOBALS['_CFG']['sms_shop_mobile'], sprintf($GLOBALS['_LANG']['order_payed_sms'], $order_sn, $order['consignee'], $order['tel']), 0);
                }
                /* 对虚拟商品的支持 */
                $virtual_goods = get_virtual_goods($order_id);
                if (!empty($virtual_goods)) {
                    $msg = '';
                    if (!virtual_goods_ship($virtual_goods, $msg, $order_sn, true)) {
                        $GLOBALS['_LANG']['pay_success'] .= '<div style="color:red;">' . $msg . '</div>' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
                    }
                    /* 如果订单没有配送方式,自动完成发货操作 */
                    if ($order['shipping_id'] == -1) {
                        /* 将订单标识为已发货状态,并记录发货记录 */
                        $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET shipping_status = '" . SS_SHIPPED . "', shipping_time = '" . gmtime() . "'" . " WHERE order_id = '{$order_id}'";
                        $GLOBALS['db']->query($sql);
                        /* 记录订单操作记录 */
                        order_action($order_sn, OS_CONFIRMED, SS_SHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                    }
                }
            } elseif ($pay_log['order_type'] == PAY_SURPLUS) {
                /* 更新会员预付款的到款状态 */
                $sql = 'UPDATE ' . $GLOBALS['ecs']->table('user_account') . " SET paid_time = '" . gmtime() . "', is_paid = 1" . " WHERE id = '{$pay_log['order_id']}' LIMIT 1";
                $GLOBALS['db']->query($sql);
                /* 取得添加预付款的用户以及金额 */
                $sql = "SELECT user_id, amount FROM " . $GLOBALS['ecs']->table('user_account') . " WHERE id = '{$pay_log['order_id']}'";
                $arr = $GLOBALS['db']->getRow($sql);
                /* 修改会员帐户金额 */
                $_LANG = array();
                include_once ROOT_PATH . 'languages/' . $GLOBALS['_CFG']['lang'] . '/user.php';
                log_account_change($arr['user_id'], $arr['amount'], 0, 0, 0, $_LANG['surplus_type_0'], ACT_SAVING);
            }
        } else {
            /* 取得已发货的虚拟商品信息 */
            $post_virtual_goods = get_virtual_goods($pay_log['order_id'], true);
            /* 有已发货的虚拟商品 */
            if (!empty($post_virtual_goods)) {
                $msg = '';
                /* 检查两次刷新时间有无超过12小时 */
                $sql = 'SELECT pay_time, order_sn FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
                $row = $GLOBALS['db']->getRow($sql);
                $intval_time = gmtime() - $row['pay_time'];
                if ($intval_time > 0 && $intval_time < 3600 * 12) {
                    $virtual_card = array();
                    foreach ($post_virtual_goods as $code => $goods_list) {
                        /* 只处理虚拟卡 */
                        if ($code == 'virtual_card') {
                            foreach ($goods_list as $goods) {
                                if ($info = virtual_card_result($row['order_sn'], $goods)) {
                                    $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                                }
                            }
                            $GLOBALS['smarty']->assign('virtual_card', $virtual_card);
                        }
                    }
                } else {
                    $msg = '<div>' . $GLOBALS['_LANG']['please_view_order_detail'] . '</div>';
                }
                $GLOBALS['_LANG']['pay_success'] .= $msg;
            }
            /* 取得未发货虚拟商品 */
            $virtual_goods = get_virtual_goods($pay_log['order_id'], false);
            if (!empty($virtual_goods)) {
                $GLOBALS['_LANG']['pay_success'] .= '<br />' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
            }
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:101,代码来源:lib_payment.php

示例3: define

/**
 * 新支付响应页面
 * time:2014-04-03
 * by:hg
 *
 *
**/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
if ($_GET['act'] == 'message') {
    if (isset($_SESSION['message']) && isset($_SESSION['message_sn'])) {
        if ($_SESSION['message'] > 0 && $_SESSION['message_sn'] > 0) {
            $order_id = $_SESSION['message'];
            $order['order_sn'] = $_SESSION['message_sn'];
            $virtual_goods = get_virtual_goods($order_id, true);
            if ($virtual_goods) {
                $virtual_card = array();
                foreach ($virtual_goods as $code => $goods_list) {
                    /* 只处理虚拟卡 */
                    if ($code == 'virtual_card') {
                        foreach ($goods_list as $goods) {
                            if ($info = virtual_card_result($order['order_sn'], $goods)) {
                                $virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => $info);
                            }
                        }
                    }
                }
                $smarty->assign('virtual_card', $virtual_card);
            }
        }
开发者ID:dlpc,项目名称:ecshop,代码行数:30,代码来源:pay_respond.php

示例4: order_paid

/**
 * 修改订单的支付状态
 *
 * @access  public
 * @param   string  $log_id     支付编号
 * @param   integer $pay_status 状态
 * @param   string  $note       备注
 * @return  void
 */
function order_paid($log_id, $pay_status = PS_PAYED, $note = '')
{
    /* 取得支付编号 */
    $log_id = intval($log_id);
    if ($log_id > 0) {
        /* 取得要修改的支付记录信息 */
        $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE log_id = '{$log_id}'";
        $pay_log = $GLOBALS['db']->getRow($sql);
        if (!empty($pay_log) && $pay_log['is_paid'] == 0) {
            /* 修改此次支付操作的状态为已付款 */
            $sql = 'UPDATE ' . $GLOBALS['ecs']->table('pay_log') . " SET is_paid = '1' WHERE log_id = '{$log_id}'";
            $GLOBALS['db']->query($sql);
            /* 根据记录类型做相应处理 */
            if ($pay_log['order_type'] == PAY_ORDER) {
                /* 取得订单信息 */
                $sql = 'SELECT order_id, user_id, order_sn, consignee, address, tel, shipping_id, extension_code, extension_id, goods_amount ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
                $order = $GLOBALS['db']->getRow($sql);
                $order_id = $order['order_id'];
                $order_sn = $order['order_sn'];
                /* 修改订单状态为已付款 */
                $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET pay_status = '{$pay_status}', " . " pay_time = '" . gmtime() . "', " . " money_paid = order_amount," . " order_amount = 0 " . "WHERE order_id = '{$order_id}'";
                $GLOBALS['db']->query($sql);
                /* 记录订单操作记录 */
                order_action($order_sn, OS_UNCONFIRMED, SS_UNSHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                /* 如果需要,发短信 */
                /*if ($GLOBALS['_CFG']['sms_order_payed'] == '1' && $GLOBALS['_CFG']['sms_shop_mobile'] != '')
                             {
                                 include_once(ROOT_PATH.'include/cls_sms.php');
                                 $sms = new sms();
                   		$sms_error = array();
                                 if(!$sms->send($GLOBALS['_CFG']['sms_shop_mobile'], sprintf($GLOBALS['_LANG']['order_payed_sms'], $order_sn, $order['consignee'], $order['tel']), $sms_error)){
                			echo $sms_error;
                		}
                             }*/
                // 检查限时抢购促销数量
                $sql = "select f.id, f.promote_num, sum(b.goods_number) AS sale_num FROM " . $GLOBALS['ecs']->table('order_goods', 'a') . "," . $GLOBALS['ecs']->table('order_goods', 'b') . "," . $GLOBALS['ecs']->table('order_info', 'o') . "," . $GLOBALS['ecs']->table('flash_sale', 'f') . " WHERE a.extension_code = b.extension_code AND a.extension_id = b.extension_id AND f.id = a.extension_id AND " . " o.order_id = b.order_id AND o.pay_status = " . PS_PAYED . " AND a.extension_code = 'flash_sale' AND a.order_id = '{$order_id}' " . " GROUP BY a.extension_id";
                $result = $GLOBALS['db']->getAll($sql);
                if (!empty($result)) {
                    foreach ($result as $flash) {
                        if ($flash['promote_num'] > 0 && $flash['promote_num'] <= $flash['sale_num']) {
                            $sql = "UPDATE " . $GLOBALS['ecs']->table('flash_sale') . " SET is_on_sale = 0 WHERE id = '{$flash['id']}'";
                            $GLOBALS['db']->query($sql);
                        }
                    }
                }
                /* 对虚拟商品的支持 */
                $virtual_goods = get_virtual_goods($order_id);
                if (!empty($virtual_goods)) {
                    $msg = '';
                    if (!virtual_goods_ship($virtual_goods, $msg, $order_sn, true)) {
                        $GLOBALS['_LANG']['pay_success'] .= '<div style="color:red;">' . $msg . '</div>' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
                    }
                    /* 如果订单没有配送方式,自动完成发货操作 */
                    if ($order['shipping_id'] == -1) {
                        /* 将订单标识为已发货状态,并记录发货记录 */
                        $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET shipping_status = '" . SS_SHIPPED . "', shipping_time = '" . gmtime() . "'" . " WHERE order_id = '{$order_id}'";
                        $GLOBALS['db']->query($sql);
                        /* 记录订单操作记录 */
                        order_action($order_sn, OS_CONFIRMED, SS_SHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                        $integral = integral_to_give($order);
                        log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['order_gift_integral'], $order['order_sn']));
                    }
                }
            } elseif ($pay_log['order_type'] == PAY_SURPLUS) {
                $sql = 'SELECT `id` FROM ' . $GLOBALS['ecs']->table('user_account') . " WHERE `id` = '{$pay_log['order_id']}' AND `is_paid` = 1  LIMIT 1";
                $res_id = $GLOBALS['db']->getOne($sql);
                if (empty($res_id)) {
                    /* 更新会员预付款的到款状态 */
                    $sql = 'UPDATE ' . $GLOBALS['ecs']->table('user_account') . " SET paid_time = '" . gmtime() . "', is_paid = 1" . " WHERE id = '{$pay_log['order_id']}' LIMIT 1";
                    $GLOBALS['db']->query($sql);
                    /* 取得添加预付款的用户以及金额 */
                    $sql = "SELECT user_id, amount FROM " . $GLOBALS['ecs']->table('user_account') . " WHERE id = '{$pay_log['order_id']}'";
                    $arr = $GLOBALS['db']->getRow($sql);
                    /* 修改会员帐户金额 */
                    $_LANG = array();
                    include_once ROOT_PATH . 'lang/' . $GLOBALS['_CFG']['lang'] . '/user.php';
                    log_account_change($arr['user_id'], $arr['amount'], 0, 0, 0, $_LANG['surplus_type_0'], ACT_SAVING);
                }
            }
        }
    }
}
开发者ID:GYWang1983,项目名称:fruit,代码行数:91,代码来源:lib_payment.php

示例5: gmtime

     /* 标记订单为已确认,配货中 */
     if ($order['order_status'] != OS_CONFIRMED) {
         $arr['order_status'] = OS_CONFIRMED;
         $arr['confirm_time'] = gmtime();
     }
     $arr['shipping_status'] = SS_PREPARING;
     update_order($order_id, $arr);
     /* 记录log */
     order_action($order['order_sn'], OS_CONFIRMED, SS_PREPARING, $order['pay_status'], $action_note);
     /* 清除缓存 */
     clear_cache_files();
 } elseif ('ship' == $operation) {
     /* 取得发货单号 */
     $invoice_no = $_REQUEST['invoice_no'];
     /* 对虚拟商品的支持 */
     $virtual_goods = get_virtual_goods($order_id);
     if (!empty($virtual_goods)) {
         if (!virtual_goods_ship($virtual_goods, $msg, $order['order_sn'])) {
             $links[] = array('text' => $_LANG['order_info'], 'href' => 'order.php?act=info&order_id=' . $order_id);
             sys_msg($msg, 0, $links);
         }
     }
     /* 标记订单为已确认 “已发货” */
     /* 更新发货时间和发货单号 */
     $shipping_status = SS_SHIPPED;
     if ($order['order_status'] != OS_CONFIRMED) {
         $arr['order_status'] = OS_CONFIRMED;
         $arr['confirm_time'] = gmtime();
     }
     $arr['shipping_status'] = $shipping_status;
     $arr['shipping_time'] = gmtime();
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:order.php

示例6: order_paid

/**
 * 修改订单的支付状态
 *
 * @access  public
 * @param   string  $log_id     支付编号
 * @param   integer $pay_status 状态
 * @param   string  $note       备注
 * @return  void
 */
function order_paid($log_id, $pay_status = PS_PAYED, $note = '')
{
    /* 取得支付编号 */
    $log_id = intval($log_id);
    if ($log_id > 0) {
        /* 取得要修改的支付记录信息 */
        $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE log_id = '{$log_id}'";
        $pay_log = $GLOBALS['db']->getRow($sql);
        if ($pay_log && $pay_log['is_paid'] == 0) {
            /* 修改此次支付操作的状态为已付款 */
            $sql = 'UPDATE ' . $GLOBALS['ecs']->table('pay_log') . " SET is_paid = '1' WHERE log_id = '{$log_id}'";
            $GLOBALS['db']->query($sql);
            /* 根据记录类型做相应处理 */
            if ($pay_log['order_type'] == PAY_ORDER) {
                /* 取得订单信息 */
                $sql = 'SELECT order_id, user_id, order_sn, consignee, address, tel, shipping_id, extension_code, extension_id, goods_amount ' . 'FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE order_id = '{$pay_log['order_id']}'";
                $order = $GLOBALS['db']->getRow($sql);
                $order_id = $order['order_id'];
                $order_sn = $order['order_sn'];
                /* 修改订单状态为已付款 */
                $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET order_status = '" . OS_CONFIRMED . "', " . " confirm_time = '" . gmtime() . "', " . " pay_status = '{$pay_status}', " . " pay_time = '" . gmtime() . "', " . " money_paid = order_amount," . " order_amount = 0 " . "WHERE order_id = '{$order_id}'";
                $GLOBALS['db']->query($sql);
                /* 记录订单操作记录 */
                order_action($order_sn, OS_CONFIRMED, SS_UNSHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                /* Added by Jack for sms , 2015.05.24  */
                global $smarty;
                /* 客户付款时给商家发送短信提醒 */
                if ($GLOBALS['_CFG']['ihuyi_sms_order_payed'] == '1' && $GLOBALS['_CFG']['ihuyi_sms_shop_mobile'] != '') {
                    require_once ROOT_PATH . 'includes/lib_sms.php';
                    $smarty->assign('shop_name', $GLOBALS['_CFG']['shop_name']);
                    $smarty->assign('order_sn', $order['order_sn']);
                    $smarty->assign('consignee', $order['consignee']);
                    $smarty->assign('tel', $order['tel']);
                    $content = $smarty->fetch('str:' . $GLOBALS['_CFG']['ihuyi_sms_order_payed_value']);
                    $ret = sendsms($GLOBALS['_CFG']['ihuyi_sms_shop_mobile'], $content);
                }
                /* 获取用户手机号 */
                $sql = "SELECT user_id, mobile_phone FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id='{$order['user_id']}' LIMIT 1";
                $row = $GLOBALS['db']->getRow($sql);
                /* 客户付款时给客户发送短信提醒 */
                if ($GLOBALS['_CFG']['ihuyi_sms_customer_payed'] == '1' && $row['mobile_phone'] != '') {
                    require_once ROOT_PATH . 'includes/lib_sms.php';
                    $smarty->assign('shop_name', $GLOBALS['_CFG']['shop_name']);
                    $smarty->assign('order_sn', $order['order_sn']);
                    $smarty->assign('time', local_date(date('Y-m-d H:i:s', time())));
                    $content = $smarty->fetch('str:' . $GLOBALS['_CFG']['ihuyi_sms_customer_payed_value']);
                    $ret = sendsms($row['mobile_phone'], $content);
                }
                /* End for sms  */
                /* 如果需要,发短信 */
                if ($GLOBALS['_CFG']['sms_order_payed'] == '1' && $GLOBALS['_CFG']['sms_shop_mobile'] != '') {
                    include_once ROOT_PATH . 'includes/cls_sms.php';
                    $sms = new sms();
                    $sms->send($GLOBALS['_CFG']['sms_shop_mobile'], sprintf($GLOBALS['_LANG']['order_payed_sms'], $order_sn, $order['consignee'], $order['tel']), '', 13, 1);
                }
                /* 对虚拟商品的支持 */
                $virtual_goods = get_virtual_goods($order_id);
                if (!empty($virtual_goods)) {
                    $msg = '';
                    if (!virtual_goods_ship($virtual_goods, $msg, $order_sn, true)) {
                        $GLOBALS['_LANG']['pay_success'] .= '<div style="color:red;">' . $msg . '</div>' . $GLOBALS['_LANG']['virtual_goods_ship_fail'];
                    }
                    /* 如果订单没有配送方式,自动完成发货操作 */
                    if ($order['shipping_id'] == -1) {
                        /* 将订单标识为已发货状态,并记录发货记录 */
                        $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET shipping_status = '" . SS_SHIPPED . "', shipping_time = '" . gmtime() . "'" . " WHERE order_id = '{$order_id}'";
                        $GLOBALS['db']->query($sql);
                        /* 记录订单操作记录 */
                        order_action($order_sn, OS_CONFIRMED, SS_SHIPPED, $pay_status, $note, $GLOBALS['_LANG']['buyer']);
                        $integral = integral_to_give($order);
                        log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($GLOBALS['_LANG']['order_gift_integral'], $order['order_sn']));
                    }
                }
            } elseif ($pay_log['order_type'] == PAY_SURPLUS) {
                $sql = 'SELECT `id` FROM ' . $GLOBALS['ecs']->table('user_account') . " WHERE `id` = '{$pay_log['order_id']}' AND `is_paid` = 1  LIMIT 1";
                $res_id = $GLOBALS['db']->getOne($sql);
                if (empty($res_id)) {
                    /* 更新会员预付款的到款状态 */
                    $sql = 'UPDATE ' . $GLOBALS['ecs']->table('user_account') . " SET paid_time = '" . gmtime() . "', is_paid = 1" . " WHERE id = '{$pay_log['order_id']}' LIMIT 1";
                    $GLOBALS['db']->query($sql);
                    /* 取得添加预付款的用户以及金额 */
                    $sql = "SELECT user_id, amount FROM " . $GLOBALS['ecs']->table('user_account') . " WHERE id = '{$pay_log['order_id']}'";
                    $arr = $GLOBALS['db']->getRow($sql);
                    /* 修改会员帐户金额 */
                    $_LANG = array();
                    include_once ROOT_PATH . 'languages/' . $GLOBALS['_CFG']['lang'] . '/user.php';
                    log_account_change($arr['user_id'], $arr['amount'], 0, 0, 0, $_LANG['surplus_type_0'], ACT_SAVING);
                }
            }
        } else {
            /* 取得已发货的虚拟商品信息 */
//.........这里部分代码省略.........
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:101,代码来源:lib_payment.php


注:本文中的get_virtual_goods函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。