本文整理汇总了PHP中virtual_goods_ship函数的典型用法代码示例。如果您正苦于以下问题:PHP virtual_goods_ship函数的具体用法?PHP virtual_goods_ship怎么用?PHP virtual_goods_ship使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了virtual_goods_ship函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'];
}
//.........这里部分代码省略.........
示例2: sms
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']), 0);
}
/* 如果订单金额为0 处理虚拟卡 */
if ($order['order_amount'] <= 0) {
$sql = "SELECT goods_id, goods_name, goods_number AS num FROM " . $GLOBALS['ecs']->table('cart') . " WHERE is_real = 0 AND extension_code = 'virtual_card'" . " AND session_id = '" . SESS_ID . "' AND rec_type = '{$flow_type}'";
$res = $GLOBALS['db']->getAll($sql);
$virtual_goods = array();
foreach ($res as $row) {
$virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
}
if ($virtual_goods and $flow_type != CART_GROUP_BUY_GOODS) {
/* 虚拟卡发货 */
if (virtual_goods_ship($virtual_goods, $msg, $order['order_sn'], true)) {
/* 如果没有实体商品,修改发货状态,送积分和红包 */
$sql = "SELECT COUNT(*)" . " FROM " . $ecs->table('order_goods') . " WHERE order_id = '{$order['order_id']}' " . " AND is_real = 1";
if ($db->getOne($sql) <= 0) {
/* 修改订单状态 */
update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
/* 如果订单用户不为空,计算积分,并发给用户;发红包 */
if ($order['user_id'] > 0) {
/* 取得用户信息 */
$user = user_info($order['user_id']);
/* 计算并发放积分 */
$integral = integral_to_give($order);
log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
/* 发放红包 */
send_order_bonus($order['order_id']);
}
示例3: done
//.........这里部分代码省略.........
$content = $smarty->fetch('str:' . $tpl['template_content']);
*/
send_mail($_CFG['shop_name'], $_CFG['service_email'], $tpl['template_subject'], $content, $tpl['is_html']);
}
error_log('2',3,'flow.log');
/* 如果需要,发短信 */
if ($_CFG['sms_order_placed'] == '1' && $_CFG['sms_shop_mobile'] != '')
{
include_once(RPC_ROOT.'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']), 0);
}
error_log('3',3,'flow.log');
/* 如果订单金额为0 处理虚拟卡 */
if ($order['order_amount'] <= 0)
{
$sql = " SELECT goods_id, goods_name, goods_number AS num FROM ".$GLOBALS['ecs']->table('cart') .
" WHERE is_real = 0 AND extension_code = 'virtual_card'".
" AND session_id = '".SESS_ID."' AND rec_type = '$flow_type'";
$res = $GLOBALS['db']->getAll($sql);
error_log('4',3,'flow.log');
$virtual_goods = array();
foreach ($res AS $row)
{
$virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
}
if ($virtual_goods AND $flow_type != CART_GROUP_BUY_GOODS)
{
/* 虚拟卡发货 */
if (virtual_goods_ship($virtual_goods,$msg, $order['order_sn'], true))
{
/* 如果没有实体商品,修改发货状态,送积分和红包 */
$sql = "SELECT COUNT(*)" .
" FROM " . $ecs->table('order_goods') .
" WHERE order_id = '$order[order_id]' " .
" AND is_real = 1";
if ($db->getOne($sql) <= 0)
{
/* 修改订单状态 */
update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
error_log('5',3,'flow.log');
/* 如果订单用户不为空,计算积分,并发给用户;发红包 */
if ($order['user_id'] > 0)
{
/* 取得用户信息 */
$user = user_info($order['user_id']);
/* 计算并发放积分 */
$integral = integral_to_give($order);
log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf($_LANG['order_gift_integral'], $order['order_sn']));
error_log('6',3,'flow.log');
/* 发放红包 */
send_order_bonus($order['order_id']);
}
}
}
}
}
/* 清空购物车 */
clear_cart($flow_type);
示例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);
}
}
}
}
}
示例5: gmtime
$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();
$arr['invoice_no'] = $invoice_no;
update_order($order_id, $arr);
示例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 {
/* 取得已发货的虚拟商品信息 */
//.........这里部分代码省略.........