本文整理汇总了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;
//.........这里部分代码省略.........