本文整理汇总了PHP中virtual_card_result函数的典型用法代码示例。如果您正苦于以下问题:PHP virtual_card_result函数的具体用法?PHP virtual_card_result怎么用?PHP virtual_card_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了virtual_card_result函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
}
//.........这里部分代码省略.........
示例2: virtual_goods_ship
/**
* 虚拟商品发货
*
* @access public
* @param array $virtual_goods 虚拟商品数组
* @param string $msg 错误信息
* @param string $order_sn 订单号。
* @param string $process 设定当前流程:split,发货分单流程;other,其他,默认。
*
* @return bool
*/
function virtual_goods_ship(&$virtual_goods, &$msg, $order_sn, $return_result = false, $process = 'other')
{
$virtual_card = array();
foreach ($virtual_goods as $code => $goods_list) {
/* 只处理虚拟卡 */
if ($code == 'virtual_card') {
foreach ($goods_list as $goods) {
if (virtual_card_shipping($goods, $order_sn, $msg, $process)) {
if ($return_result) {
$virtual_card[] = array('goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'info' => virtual_card_result($order_sn, $goods));
}
} else {
return false;
}
}
$GLOBALS['smarty']->assign('virtual_card', $virtual_card);
}
}
return true;
}
示例3: define
**/
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);
}
}
$payArr['order_id'] = $_GET['order_id'];
$payArr['status'] = $_GET['status'];
$payArr['payprice'] = $_GET['money'];
/* ccx 2014-12-13 获取抽奖活动地址链接相关信息 开始*/
$payArr['email'] = $_GET['email'];
$payArr['user_id'] = $_GET['user_id'];
$payArr['datetime'] = gmtime();
示例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 ($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'];
}
//.........这里部分代码省略.........
示例5: order_paid
//.........这里部分代码省略.........
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 {
/* 取得已发货的虚拟商品信息 */
$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'];
}
}
}
}