本文整理匯總了PHP中unserialize_config函數的典型用法代碼示例。如果您正苦於以下問題:PHP unserialize_config函數的具體用法?PHP unserialize_config怎麽用?PHP unserialize_config使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了unserialize_config函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: respond
function respond() {
ini_set("display_errors","On");
$where = array('ologin_code'=>front::$get['ologin_code']);
$ologins = ologin::getInstance()->getrows($where);
$ologin = unserialize_config($ologins[0]['ologin_config']);
//var_dump($ologin);
$aliapy_config['partner'] = $ologin['alipaylogin_id'];
$aliapy_config['key'] = $ologin['alipaylogin_key'];
$aliapy_config['return_url'] = ologin::url(basename(__FILE__,'.php'));
$aliapy_config['sign_type'] = 'MD5';
$aliapy_config['input_charset']= 'utf-8';
$aliapy_config['transport'] = 'http';
$aliapy_config['cacert'] = getcwd().'/lib/plugins/alipayauth/cacert.pem';
//var_dump($aliapy_config);
unset($_GET['case']);unset($_GET['act']);unset($_GET['ologin_code']);unset($_GET['site']);
require_once("alipayauth/alipay_notify.class.php");
$alipayNotify = new AlipayNotify($aliapy_config);
//var_dump($alipayNotify);
$verify_result = $alipayNotify->verifyReturn();
//var_dump($verify_result);
if($verify_result) {//驗證成功
$user_id = front::$get['user_id'];
$token = front::$get['token'];
session::set('access_token',$token);
session::set("openid",$user_id);
return array('nickname'=> front::get('real_name'));
}
else {
echo "驗證失敗";exit;
}
}
示例2: respond_post
/**
* 服務器端 POST形式響應
*/
public function respond_post()
{
$_POST['code'] = $_POST['code'] ? $_POST['code'] : $_GET['code'];
if ($_POST['code']) {
$payment = $this->get_by_code($_POST['code']);
if (!$payment) {
error_log(date('m-d H:i:s', SYS_TIME) . '| POST: payment is null |' . "\r\n", 3, CACHE_PATH . 'pay_error_log.php');
}
$cfg = unserialize_config($payment['config']);
$pay_name = ucwords($payment['pay_code']);
pc_base::load_app_class('pay_factory', '', 0);
$payment_handler = new pay_factory($pay_name, $cfg);
$return_data = $payment_handler->notify();
if ($return_data) {
if ($return_data['order_status'] == 0) {
$this->update_member_amount_by_sn($return_data['order_id']);
}
$this->update_recode_status_by_sn($return_data['order_id'], $return_data['order_status']);
$result = TRUE;
} else {
$result = FALSE;
}
$payment_handler->response($result);
}
}
示例3: respond
function respond() {
$logintype = front::$get['ologin_code'];
$where = array('ologin_code' => $logintype);
$ologins = ologin::getInstance()->getrows($where);
$ologin_cfg = unserialize_config($ologins[0]['ologin_config']);
$this->qq_callback($ologin_cfg);
return $this->get_openid($ologin_cfg);
}
示例4: ologin_action
function ologin_action(){
$logintype = $_GET['logtype'];
$where = array('ologin_code'=>$logintype);
$ologins = ologin::getInstance()->getrows($where);
include_once ROOT.'/lib/plugins/ologin/'.$logintype.'.php';
$loginobj = new $logintype();
$url = $loginobj->get_code(unserialize_config($ologins[0]['ologin_config']));
@header("Location: $url");
exit;
}
示例5: shipping_area_info
/**
* 取得某配送方式對應於某收貨地址的區域信息
* @param int $shipping_id 配送方式id
* @param array $region_id_list 收貨人地區id數組
* @return array 配送區域信息(config 對應著反序列化的 configure)
*/
function shipping_area_info($shipping_id, $region_id_list)
{
$sql = 'SELECT s.shipping_code, s.shipping_name, ' . 's.shipping_desc, s.insure, s.support_cod, a.configure ' . 'FROM ' . $GLOBALS['ecs']->table('shipping') . ' AS s, ' . $GLOBALS['ecs']->table('shipping_area') . ' AS a, ' . $GLOBALS['ecs']->table('area_region') . ' AS r ' . "WHERE s.shipping_id = '{$shipping_id}' " . 'AND r.region_id ' . db_create_in($region_id_list) . ' AND r.shipping_area_id = a.shipping_area_id AND a.shipping_id = s.shipping_id AND s.enabled = 1';
$row = $GLOBALS['db']->getRow($sql);
if (!empty($row)) {
$shipping_config = unserialize_config($row['configure']);
if (isset($shipping_config['pay_fee'])) {
if (strpos($shipping_config['pay_fee'], '%') !== false) {
$row['pay_fee'] = floatval($shipping_config['pay_fee']) . '%';
} else {
$row['pay_fee'] = floatval($shipping_config['pay_fee']);
}
} else {
$row['pay_fee'] = 0.0;
}
}
return $row;
}
示例6: respondGet
/**
* --------------------------------------------------------------
* 服務器端get響應
* --------------------------------------------------------------
* 返回成功提示,5秒後跳轉到指定頁麵
*/
public function respondGet($code = '')
{
if (empty($code)) {
return false;
}
\Omnipay::setGateway($code);
$resquest = \Omnipay::completePurchase(['request_params' => \Input::all()]);
$response = $resquest->send();
if ($response->isSuccessful()) {
//TODO
//驗證成功
//更新賬戶餘額
//更新訂單狀態
} else {
}
if ($code) {
$payment = $this->get_by_code($_GET['code']);
if (!$payment) {
showmessage(L('payment_failed'));
}
$cfg = unserialize_config($payment['config']);
$pay_name = ucwords($payment['pay_code']);
pc_base::load_app_class('pay_factory', '', 0);
$payment_handler = new pay_factory($pay_name, $cfg);
$return_data = $payment_handler->receive();
if ($return_data) {
if ($return_data['order_status'] == 0) {
$this->update_member_amount_by_sn($return_data['order_id']);
}
$this->update_recode_status_by_sn($return_data['order_id'], $return_data['order_status']);
//支付成功
//showmessage(L('pay_success'),APP_PATH.'index.php?m=pay&c=deposit');
} else {
//支付失敗
//showmessage(L('pay_failed'),APP_PATH.'index.php?m=pay&c=deposit');
}
} else {
//支付成功
}
}
示例7: done
//.........這裏部分代碼省略.........
/* 如果沒有實體商品,修改發貨狀態,送積分和紅包 */
$count = $this->model->table('order_goods')->field('COUNT(*)')->where("order_id = '{$order['order_id']}' " . " AND is_real = 1")->getOne();
if ($count <= 0) {
/* 修改訂單狀態 */
model('Users')->update_order($order['order_id'], array('shipping_status' => SS_SHIPPED, 'shipping_time' => gmtime()));
/* 如果訂單用戶不為空,計算積分,並發給用戶;發紅包 */
if ($order['user_id'] > 0) {
/* 取得用戶信息 */
$user = model('Order')->user_info($order['user_id']);
/* 計算並發放積分 */
$integral = model('Order')->integral_to_give($order);
model('ClipsBase')->log_account_change($order['user_id'], 0, 0, intval($integral['rank_points']), intval($integral['custom_points']), sprintf(L('order_gift_integral'), $order['order_sn']));
}
}
}
}
}
// 銷量
model('Flow')->add_touch_goods($flow_type, $order['extension_code']);
/* 記錄供應商信息 */
$sql = "update " . $this->model->pre . "order_goods og , " . $this->model->pre . "goods g set og.suppliers_id=g.suppliers_id\r\n where og.goods_id=g.goods_id and og.order_id='" . $order['order_id'] . "'";
$this->model->query($sql);
/* 清空購物車 */
model('Order')->clear_cart($flow_type);
/* 清除緩存,否則買了商品,但是前台頁麵讀取緩存,商品數量不減少 */
clear_all_files();
/* 插入支付日誌 */
$order['log_id'] = model('ClipsBase')->insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
/* 取得支付信息,生成支付代碼 */
if ($order['order_amount'] > 0) {
$payment = model('Order')->payment_info($order['pay_id']);
include_once ROOT_PATH . 'plugins/payment/' . $payment['pay_code'] . '.php';
$pay_obj = new $payment['pay_code']();
$pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
$order['pay_desc'] = $payment['pay_desc'];
$this->assign('pay_online', $pay_online);
}
if (!empty($order['shipping_name'])) {
$order['shipping_name'] = trim(stripcslashes($order['shipping_name']));
}
// 貨到付款不顯示
if ($payment['pay_code'] != 'balance') {
/* 生成訂單後,修改支付,配送方式 */
// 支付方式
$payment_list = model('Order')->available_payment_list(0);
if (isset($payment_list)) {
foreach ($payment_list as $key => $payment) {
/* 如果有易寶神州行支付 如果訂單金額大於300 則不顯示 */
if ($payment['pay_code'] == 'yeepayszx' && $total['amount'] > 300) {
unset($payment_list[$key]);
}
// 過濾掉當前的支付方式
if ($payment['pay_id'] == $order['pay_id']) {
unset($payment_list[$key]);
}
/* 如果有餘額支付 */
if ($payment['pay_code'] == 'balance') {
/* 如果未登錄,不顯示 */
if ($_SESSION['user_id'] == 0) {
unset($payment_list[$key]);
} else {
if ($_SESSION['flow_order']['pay_id'] == $payment['pay_id']) {
$this->assign('disable_surplus', 1);
}
}
}
示例8: ecs_header
}
//如果原來的支付方式已禁用或者已刪除, 重新選擇支付方式
if ($payment_id == 0) {
ecs_header("Location: user.php?act=account_deposit&id=" . $surplus_id . "\n");
exit;
}
//獲取單條會員帳目信息
$order = array();
$order = get_surplus_info($surplus_id);
//支付方式的信息
$payment_info = array();
$payment_info = payment_info($payment_id);
/* 如果當前支付方式沒有被禁用,進行支付的操作 */
if (!empty($payment_info)) {
//取得支付信息,生成支付代碼
$payment = unserialize_config($payment_info['pay_config']);
//生成偽訂單號
$order['order_sn'] = $surplus_id;
//獲取需要支付的log_id
$order['log_id'] = get_paylog_id($surplus_id, $pay_type = PAY_SURPLUS);
$order['user_name'] = $_SESSION['user_name'];
$order['surplus_amount'] = $order['amount'];
//計算支付手續費用
$payment_info['pay_fee'] = pay_fee($payment_id, $order['surplus_amount'], 0);
//計算此次預付款需要支付的總金額
$order['order_amount'] = $order['surplus_amount'] + $payment_info['pay_fee'];
//如果支付費用改變了,也要相應的更改pay_log表的order_amount
$order_amount = $db->getOne("SELECT order_amount FROM " . $ecs->table('pay_log') . " WHERE log_id = '{$order['log_id']}'");
if ($order_amount != $order['order_amount']) {
$db->query("UPDATE " . $ecs->table('pay_log') . " SET order_amount = '{$order['order_amount']}' WHERE log_id = '{$order['log_id']}'");
}
示例9: pay
/**
* 會員通過帳目明細列表進行再付款的操作
*/
public function pay()
{
//變量初始化
$surplus_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$payment_id = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
if ($surplus_id == 0) {
ecs_header("Location: " . url('User/account_log'));
exit;
}
//如果原來的支付方式已禁用或者已刪除, 重新選擇支付方式
if ($payment_id == 0) {
ecs_header("Location: " . url('User/account_deposit', array('id' => $surplus_id)));
exit;
}
//獲取單條會員帳目信息
$order = array();
$order = model('ClipsBase')->get_surplus_info($surplus_id);
//支付方式的信息
$payment_info = array();
$payment_info = model('Order')->payment_info($payment_id);
/* 如果當前支付方式沒有被禁用,進行支付的操作 */
if (!empty($payment_info)) {
//取得支付信息,生成支付代碼
$payment = unserialize_config($payment_info['pay_config']);
//生成偽訂單號
$order['order_sn'] = $surplus_id;
//獲取需要支付的log_id
$order['log_id'] = model('ClipsBase')->get_paylog_id($surplus_id, $pay_type = PAY_SURPLUS);
$order['user_name'] = $_SESSION['user_name'];
$order['surplus_amount'] = $order['amount'];
//計算支付手續費用
$payment_info['pay_fee'] = pay_fee($payment_id, $order['surplus_amount'], 0);
//計算此次預付款需要支付的總金額
$order['order_amount'] = $order['surplus_amount'] + $payment_info['pay_fee'];
//如果支付費用改變了,也要相應的更改pay_log表的order_amount
$order_amount = M()->getOne("SELECT order_amount FROM " . M()->pre . 'pay_log' . " WHERE log_id = '{$order['log_id']}'");
$this->model->table('order_goods')->field('COUNT(*)')->where("order_id = '{$order['order_id']}' " . " AND is_real = 1")->getOne();
if ($order_amount != $order['order_amount']) {
M()->query("UPDATE " . M()->pre . "pay_log SET order_amount = '{$order['order_amount']}' WHERE log_id = '{$order['log_id']}'");
}
/* 調用相應的支付方式文件 */
include_once ROOT_PATH . 'plugins/payment/' . $payment_info['pay_code'] . '.php';
/* 取得在線支付方式的支付按鈕 */
$pay_obj = new $payment_info['pay_code']();
$payment_info['pay_button'] = $pay_obj->get_code($order, $payment);
/* 模板賦值 */
$this->assign('payment', $payment_info);
$this->assign('order', $order);
$this->assign('pay_fee', price_format($payment_info['pay_fee'], false));
$this->assign('amount', price_format($order['surplus_amount'], false));
$this->display('user_act_account.dwt');
} else {
$this->assign('payment', model('ClipsBase')->get_online_payment_list());
$this->assign('order', $order);
$this->display('user_account_deposit.dwt');
}
}
示例10: 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)
{
$order_id = intval($order_id);
if ($order_id <= 0) {
ECTouch::err()->add(L('invalid_order_id'));
return false;
}
$order = model('Order')->order_info($order_id);
//切換手機訂單的關聯的支付方式
if ($order['mobile_pay'] <= 0) {
//查詢手機版支付方式的配置參數
$sql = "SELECT pay_id, pay_config FROM " . $this->pre . 'touch_payment';
$touch_payment_list = $this->query($sql);
if (is_array($touch_payment_list)) {
foreach ($touch_payment_list as $vo) {
$touch_store = unserialize($vo['pay_config']);
/* 取出已經設置屬性的code */
$touch_code_list = array();
foreach ($touch_store as $key => $value) {
if ($value['name'] == 'relate_pay' && $value['value'] == $order['pay_id']) {
$touch_pay_id = $vo['pay_id'];
}
}
}
}
// 默認沒有設置關聯支付方式的
if ($touch_pay_id <= 0) {
$payment_list = model('Order')->available_payment_list(false, 0, true);
/* 過濾掉餘額支付方式 */
if (is_array($payment_list)) {
foreach ($payment_list as $key => $payment) {
if ($payment['pay_code'] != 'balance') {
$touch_pay_id = $payment['pay_id'];
break;
}
}
}
}
/* 檢查訂單是否未付款和未發貨 以及訂單金額是否為0 和支付id是否為改變 */
if ($touch_pay_id > 0 && $order['pay_status'] == PS_UNPAYED && $order['shipping_status'] == SS_UNSHIPPED && $order['goods_amount'] > 0) {
//查詢電腦版支付方式
$touch_payment_info = model('Order')->payment_info($touch_pay_id);
$order['pay_id'] = $touch_payment_info['pay_id'];
$order['pay_name'] = $touch_payment_info['pay_name'];
$order_amount = $order['order_amount'] - $order['pay_fee'];
$pay_fee = pay_fee($touch_pay_id, $order_amount);
$order_amount += $pay_fee;
$sql = "UPDATE " . $this->pre . "order_info SET pay_id='{$touch_pay_id}', pay_name='{$touch_payment_info['pay_name']}', pay_fee='{$pay_fee}', order_amount='{$order_amount}', `mobile_pay` = '1'" . " WHERE order_id = '{$order_id}'";
$this->query($sql);
}
}
//檢查訂單是否屬於該用戶
if ($user_id > 0 && $user_id != $order['user_id']) {
ECTouch::err()->add(L('no_priv'));
return false;
}
/* 對發貨號處理 */
if (!empty($order['invoice_no'])) {
$sql = "SELECT shipping_code FROM " . $this->pre . "shipping WHERE shipping_id = '{$order['shipping_id']}'";
$res = $this->row($sql);
$shipping_code = $res['shipping_code'];
$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'] = model('Order')->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 = Model('Order')->payment_info($order['pay_id']);
//無效支付方式
if ($payment_info === false) {
$order['pay_online'] = '';
} else {
//取得支付信息,生成支付代碼
$payment = unserialize_config($payment_info['pay_config']);
//.........這裏部分代碼省略.........
示例11: insert_get_shop_shipping
/**
* 獲取不同商家的運費方式
**/
function insert_get_shop_shipping($arr)
{
global $db, $ecs;
$need_cache = $GLOBALS['smarty']->caching;
$need_compile = $GLOBALS['smarty']->force_compile;
$order = $_SESSION['flow_order'];
//獲取訂單信息
$suppid = intval($arr['suppid']);
$consignee = $arr['consignee'];
$flow_type = $arr['flow_type'];
$region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
$shipping_list = available_shipping_list($region, $suppid);
$cart_weight_price = cart_weight_price2($flow_type, $suppid);
if (count($shipping_list) > 0) {
//獲取當前地址下所有的配送方式
$shipping_id = array();
foreach ($shipping_list as $v) {
$shipping_id[] = $v['shipping_id'];
}
$i = 0;
$sql_where = $_SESSION['user_id'] > 0 ? "user_id='" . $_SESSION['user_id'] . "' " : "session_id = '" . SESS_ID . "' AND user_id=0 ";
$sql = 'SELECT count(*) FROM ' . $ecs->table('cart') . " WHERE {$sql_where} AND `extension_code` != 'package_buy' AND `is_shipping` = 0 AND rec_id in (" . $_SESSION['sel_cartgoods'] . ")";
//jx
$shipping_count = $db->getOne($sql);
foreach ($shipping_list as $key => $val) {
$shipping_cfg = unserialize_config($val['configure']);
$shipping_fee = $shipping_count == 0 && $cart_weight_price['free_shipping'] == 1 ? 0 : shipping_fee($val['shipping_code'], unserialize($val['configure']), $cart_weight_price['weight'], $cart_weight_price['amount'], $cart_weight_price['number']);
$shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee, false);
$shipping_list[$key]['shipping_fee'] = $shipping_fee;
$shipping_list[$key]['free_money'] = price_format($shipping_cfg['free_money'], false);
$shipping_list[$key]['insure_formated'] = strpos($val['insure'], '%') === false ? price_format($val['insure'], false) : $val['insure'];
$selected = '';
if ($i == 0 && !in_array($order['shipping_pay'][$suppid], $shipping_id)) {
$selected = 'selected';
$order['shipping_pay'][$suppid] = $val['shipping_id'];
//記錄第一個被選中的配送方式的id
}
if (isset($order['shipping_pay'][$suppid]) && intval($order['shipping_pay'][$suppid]) == $val['shipping_id'] && in_array($order['shipping_pay'][$suppid], $shipping_id)) {
$selected = 'selected';
}
$shipping_list[$key]['selected'] = $selected;
// 當前的配送方式是否支持保價
if ($val['shipping_id'] == $order['shipping_id']) {
$insure_disabled = $val['insure'] == 0;
$cod_disabled = $val['support_cod'] == 0;
}
}
}
$GLOBALS['smarty']->assign('suppid', $suppid);
$GLOBALS['smarty']->assign('shipping_list', $shipping_list);
$GLOBALS['smarty']->assign('insure_disabled', $insure_disabled);
$GLOBALS['smarty']->assign('cod_disabled', $cod_disabled);
$GLOBALS['smarty']->caching = $need_cache;
$GLOBALS['smarty']->force_compile = $need_compile;
$val = $GLOBALS['smarty']->fetch('library/shipping_list.lbi');
$_SESSION['flow_order'] = $order;
return $val;
}
示例12: payment_info
$pay_code = $arr1[0];
}
/* 判斷是否啟用 */
$sql = "SELECT pay_id FROM " . $ecs->table('touch_payment') . " WHERE pay_code = '{$pay_code}' AND enabled = 1";
$pay_id = $db->getOne($sql);
if (empty($pay_id)) {
$msg = $_LANG['pay_disabled'];
} else {
$plugin_file = 'include/modules/payment/' . $pay_code . '.php';
/* 檢查插件文件是否存在,如果存在則驗證支付是否成功,否則則返回失敗信息 */
if (file_exists($plugin_file)) {
$param = payment_info($pay_id);
/* 根據支付方式代碼創建支付類的對象並調用其響應操作方法 */
include_once $plugin_file;
$payment = new $pay_code();
$config = unserialize_config($param['pay_config']);
$config['call_type'] = $_REQUEST['call_type'];
unset($_GET['code']);
unset($_GET['call_type']);
$msg = @$payment->respond($config) ? $_LANG['pay_success'] : $_LANG['pay_fail'];
} else {
$msg = $_LANG['pay_not_exist'];
}
}
}
assign_template();
$position = assign_ur_here();
$smarty->assign('page_title', $position['title']);
// 頁麵標題
$smarty->assign('ur_here', $position['ur_here']);
// 當前位置
示例13: get_user_orders_ex
function get_user_orders_ex($user_id, $num = 10, $start = 0, $ext = null)
{
global $_CFG;
/*判斷組團的狀態*/
$sql = "select * from " . $GLOBALS['hhs']->table('order_info') . " where user_id='{$user_id}' limit " . $start . "," . $num;
$orders = $GLOBALS['db']->getAll($sql);
if (!empty($orders)) {
foreach ($orders as $v) {
if ($v['extension_code'] == 'team_goods' && $v['team_status'] == 1) {
$sql = "select pay_time from " . $GLOBALS['hhs']->table('order_info') . " where order_id=" . $v['team_sign'];
$pay_time = $GLOBALS['db']->getOne($sql);
if ($pay_time + $_CFG['team_suc_time'] * 24 * 3600 < gmtime()) {
//取消訂單
$sql = "update " . $GLOBALS['hhs']->table('order_info') . " set team_status=3,order_status=2 where team_status=1 and team_sign=" . $v['team_sign'];
$GLOBALS['db']->query($sql);
$sql = "UPDATE " . $GLOBALS['hhs']->table('order_info') . " SET order_status=2 WHERE team_status=0 and team_sign=" . $v['team_sign'];
$GLOBALS['db']->query($sql);
}
}
}
}
include_once ROOT_PATH . 'includes/lib_order.php';
/* 取得訂單列表 */
$arr = array();
$sql = "SELECT order_id,share_pay_type, order_sn, order_status, shipping_status, pay_status,pay_id, add_time,order_amount, shipping_name,shipping_id,invoice_no, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee,extension_code,extension_id,team_sign,team_first,team_status " . " FROM " . $GLOBALS['hhs']->table('order_info') . " WHERE user_id = '{$user_id}' " . $ext . " ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res)) {
if ($row['order_status'] == OS_UNCONFIRMED) {
$row['handler'] = "<a href=\"user.php?act=cancel_order&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_cancel'] . "')) return false;\">" . $GLOBALS['_LANG']['cancel'] . "</a>";
} else {
if ($row['order_status'] == OS_SPLITED) {
/* 對配送狀態的處理 */
if ($row['shipping_status'] == SS_SHIPPED) {
@($row['handler'] = "<a href=\"javascript:void(0);\" onclick='get_invoice(\"" . $row['shipping_name'] . "\",\"" . $row['invoice_no'] . "\");'>查看物流</a>");
@($row['handler'] .= "<a href=\"user.php?act=affirm_received&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_received'] . "')) return false;\">" . $GLOBALS['_LANG']['received'] . "</a>");
} elseif ($row['shipping_status'] == SS_RECEIVED) {
//@$row['handler'] = '<span style="color:red">'.$GLOBALS['_LANG']['ss_received'] .'</span>';
} else {
if ($row['pay_status'] == PS_UNPAYED) {
//@$row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" .$row['order_id']. '">' .$GLOBALS['_LANG']['pay_money']. '</a>';
} else {
//@$row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" .$row['order_id']. '">' .$GLOBALS['_LANG']['view_order']. '</a>';
}
}
} else {
//$row['handler'] = '<span style="color:red">'.$GLOBALS['_LANG']['os'][$row['order_status']] .'</span>';
}
}
$pay_online = '';
if ($row['share_pay_type'] > 0 && $row['pay_status'] == PS_UNPAYED) {
$pay_online = "<a class='state_btn_2' href='share_pay.php?id=" . $row['order_id'] . "'>代付</a>";
}
if ($row['share_pay_type'] == 0 && $row['pay_status'] == PS_UNPAYED && ($row['order_status'] == OS_UNCONFIRMED || $row['order_status'] == OS_CONFIRMED)) {
$payment_info = array();
$payment_info = payment_info($row['pay_id']);
//無效支付方式
if ($payment_info === false) {
$row['pay_online'] = '';
} else {
if ($payment_info['pay_code'] == 'cod') {
$payment_info = $GLOBALS['db']->getRow("select * from " . $GLOBALS['hhs']->table("payment") . " where pay_code='wxpay' AND enabled = 1");
}
//取得支付信息,生成支付代碼
$payment = unserialize_config($payment_info['pay_config']);
//獲取需要支付的log_id
$row['log_id'] = get_paylog_id($row['order_id'], $pay_type = PAY_ORDER);
$row['user_name'] = $_SESSION['user_name'];
$row['pay_desc'] = $payment_info['pay_desc'];
if ($row['extension_id']) {
$sql = "select goods_name from " . $GLOBALS['hhs']->table('goods') . " where goods_id=" . $row['extension_id'];
$row['goods_name'] = $GLOBALS['db']->getOne($sql);
}
/* 調用相應的支付方式文件 */
include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
if ($row['order_amount'] > 0) {
if ($payment_info['pay_code'] != 'alipay') {
/* 調用相應的支付方式文件 */
include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
/* 取得在線支付方式的支付按鈕 */
$pay_obj = new $payment_info['pay_code']();
$pay_online = $pay_obj->get_code($row, $payment);
} else {
$pay_online = '<a class="state_btn_2" href="toalipay.php?order_id=' . $row['order_id'] . '" >支付寶支付</a>';
}
}
}
}
$row['handler'] = $pay_online . $row['handler'];
$row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status'];
/*
if($row['order_status']==2){
$row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] ;
}else{
if($row['pay_status']==0){
$row['order_status'] = $GLOBALS['_LANG']['ps'][$row['pay_status']];
}else{
$row['order_status'] = $GLOBALS['_LANG']['ss'][$row['shipping_status']];// $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' .
}
}*/
$row['order_status'] = $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']];
//.........這裏部分代碼省略.........
示例14: shipping_area_info
/**
* 取得某配送方式對應於某收貨地址的區域信息
* @param int $shipping_id 配送方式id
* @param array $region_id_list 收貨人地區id數組
* @return array 配送區域信息(config 對應著反序列化的 configure)
*/
function shipping_area_info($shipping_id, $region_id_list)
{
$sql = 'SELECT s.shipping_code, s.shipping_name, ' . 's.shipping_desc, s.insure, s.support_cod,r.region_id,a.configure ' . 'FROM ' . $GLOBALS['ecs']->table('shipping') . ' AS s, ' . $GLOBALS['ecs']->table('shipping_area') . ' AS a, ' . $GLOBALS['ecs']->table('area_region') . ' AS r ' . "WHERE s.shipping_id = '{$shipping_id}' " . 'AND r.region_id ' . db_create_in($region_id_list) . ' AND r.shipping_area_id = a.shipping_area_id AND a.shipping_id = s.shipping_id AND s.enabled = 1';
$rows = $GLOBALS['db']->getAll($sql);
//echo 'aa'.$region_id_list['province'];
//dump($row);
if (!empty($rows)) {
/*如果全國的運費和該省份的運費同時設置了,過濾掉全國的運費,隻使用該省份的運費 add by 2014-09-16 9:41*/
$shipping_province = false;
foreach ($rows as $r_key => $r_val) {
if ($r_val['region_id'] == $region_id_list['province']) {
$shipping_province = true;
//如果存在某省份的運費,把省份運費標誌為true
}
}
foreach ($rows as $r_key => $r_val) {
if ($shipping_province && $r_val['region_id'] == 1) {
continue;
}
$row = $rows[$r_key];
}
//過濾結束
//$row = $row[1];
//dump($row);
$shipping_config = unserialize_config($row['configure']);
if (isset($shipping_config['pay_fee'])) {
if (strpos($shipping_config['pay_fee'], '%') !== false) {
$row['pay_fee'] = floatval($shipping_config['pay_fee']) . '%';
} else {
$row['pay_fee'] = floatval($shipping_config['pay_fee']);
}
} else {
$row['pay_fee'] = 0.0;
}
}
return $row;
}
示例15: payorders_action
function payorders_action() {
if (front::get('oid')) {
preg_match_all("/-(.*)-(.*)-(.*)/isu", front::get('oid'), $oidout);
$this->view->paytype = $oidout[3][0];
$this->view->user_id = $oidout[2][0];
$where = array();
$where['oid'] = front::get('oid');
$this->view->orders = orders::getInstance()->getrow($where);
$string = $this->view->orders['aid'];
$find = ',';
$pos = strpos($string, $find);
$this->view->statusnum = $data['status'] = $this->view->orders['status'];
switch ($data['status']) {
case 1:
$this->view->orders['status'] = lang('完成');
break;
case 2:
$this->view->orders['status'] = lang('處理中');
break;
case 3:
$this->view->orders['status'] = lang('已發貨');
break;
case 4:
$this->view->orders['status'] = lang('客戶已付款,待審核');
break;
case 5:
$this->view->orders['status'] = lang('已核實客戶支付');
break;
default:
$this->view->orders['status'] = lang('新訂單');
break;
}
if ($this->view->user['userid'] != $this->view->user_id) {
echo '<script type="text/javascript">alert("' . lang('您未登錄,請保存訂單編號') . '")</script>';
}
$logisticsid = $oidout[1][0];
if ($pos !== false) {
$_aid = $string;
$_aid = substr($_aid, 0, -1);
$this->view->archivearr1 = $this->view->_archivearr = archive::getInstance()->getrows('aid in (' . $_aid . ')', 100);
$pnums = explode(',', $this->view->orders['pnums']);
foreach ($this->view->archivearr1 as $key => $val) {
$prices = getPrices($val['attr2']);
$val['attr2'] = $prices['price'];
$this->view->archivearr1[$key]['attr2'] = $val['attr2'];
$this->view->orders[$key]['pnums'] = $pnums[$key];
$this->view->archive['title'].=$val['title'];
$where = array();
$payfilename = $where['pay_code'] = $this->view->paytype;
$this->view->pay = pay::getInstance()->getrows($where);
$where = array();
$where['id'] = $logisticsid;
$this->view->logistics = logistics::getInstance()->getrows($where);
if ($this->view->logistics[0]['cashondelivery']) {
$this->view->logistics[0]['price'] = 0.00;
} else {
if ($this->view->logistics[0]['insure']) {
$this->view->logistics[0]['price'] = $this->view->logistics[0]['price'] + ($val['attr2'] * $this->view->orders[$key]['pnums']) * ($this->view->logistics[0]['insureproportion'] / 100);
}
}
if (!isset($this->view->logistics[0]['price']))
$this->view->logistics[0]['price'] = 0;
$this->view->pay[0]['pay_fee'] = $this->view->pay[0]['pay_fee'] / 100;
$this->view->archivearr1[$key]['total'] = $val['attr2'] * $this->view->orders['pnums'] + $this->view->logistics[0]['price'] + ($val['attr2'] * $this->view->orders[$key]['pnums'] * $this->view->pay[0]['pay_fee']);
$this->view->total += $val['attr2'] * $this->view->orders[$key]['pnums'] + $this->view->logistics[0]['price'] + ($val['attr2'] * $this->view->orders[$key]['pnums'] * $this->view->pay[0]['pay_fee']);
}
$order['ordersn'] = front::get('oid');
$order['title'] = $this->view->archive['title'];
$order['id'] = $this->view->orders['id'];
$order['orderamount'] = $this->view->total;
include_once ROOT . '/lib/plugins/pay/' . $payfilename . '.php';
$payclassname = $payfilename;
$payobj = new $payclassname();
$this->view->pay[0]['pay_config'];
$this->view->gotopaygateway = $payobj->get_code($order, unserialize_config($this->view->pay[0]['pay_config']));
}else {
$this->view->archive = archive::getInstance()->getrow($this->view->orders['aid']);
$prices = getPrices($this->view->archive['attr2']);
$this->view->archive['attr2'] = $prices['price'];
$where = array();
$payfilename = $where['pay_code'] = $this->view->paytype;
$this->view->pay = pay::getInstance()->getrows($where);
$where = array();
$where['id'] = $logisticsid;
$this->view->logistics = logistics::getInstance()->getrows($where);
if ($this->view->logistics[0]['cashondelivery']) {
$this->view->logistics[0]['price'] = 0.00;
} else {
if ($this->view->logistics[0]['insure']) {
$this->view->logistics[0]['price'] = $this->view->logistics[0]['price'] + ($this->view->archive['attr2'] * $this->view->orders['pnums']) * ($this->view->logistics[0]['insureproportion'] / 100);
}
}
if (!isset($this->view->logistics[0]['price']))
$this->view->logistics[0]['price'] = 0;
$this->view->pay[0]['pay_fee'] = $this->view->pay[0]['pay_fee'] / 100;
$this->view->total = $this->view->archive['attr2'] * $this->view->orders['pnums'] + $this->view->logistics[0]['price'] + ($this->view->archive['attr2'] * $this->view->orders['pnums'] * $this->view->pay[0]['pay_fee']);
$order['ordersn'] = front::get('oid');
$order['title'] = $this->view->archive['title'];
$order['id'] = $this->view->orders['id'];
$order['orderamount'] = $this->view->total;
//.........這裏部分代碼省略.........