本文整理汇总了PHP中get_agency_by_regions函数的典型用法代码示例。如果您正苦于以下问题:PHP get_agency_by_regions函数的具体用法?PHP get_agency_by_regions怎么用?PHP get_agency_by_regions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_agency_by_regions函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: order_info
/* 如果已付款,检查金额是否变动,并执行相应操作 */
$order = order_info($order_id);
handle_order_money_change($order, $msgs, $links);
/* 显示提示信息 */
if (!empty($msgs)) {
sys_msg(join(chr(13), $msgs), 0, $links);
} else {
/* 跳转到订单详情 */
ecs_header("Location: order.php?act=info&order_id=" . $order_id . "\n");
exit;
}
}
} elseif ('consignee' == $step) {
/* 保存订单 */
$order = $_POST;
$order['agency_id'] = get_agency_by_regions(array($order['country'], $order['province'], $order['city'], $order['district']));
update_order($order_id, $order);
/* 该订单所属办事处是否变化 */
$agency_changed = $old_order['agency_id'] != $order['agency_id'];
/* todo 记录日志 */
$sn = $old_order['order_sn'];
admin_log($sn, 'edit', 'order');
if (isset($_POST['next'])) {
/* 下一步 */
if (exist_real_goods($order_id)) {
/* 存在实体商品,去配送方式 */
ecs_header("Location: order.php?act=" . $step_act . "&order_id=" . $order_id . "&step=shipping\n");
exit;
} else {
/* 不存在实体商品,去支付方式 */
ecs_header("Location: order.php?act=" . $step_act . "&order_id=" . $order_id . "&step=payment\n");
示例2: get_cart_goods
$cart_goods_stock = get_cart_goods();
$_cart_goods_stock = array();
foreach ($cart_goods_stock['goods_list'] as $value) {
$_cart_goods_stock[$value['rec_id']] = $value['goods_number'];
}
flow_cart_stock($_cart_goods_stock);
unset($cart_goods_stock, $_cart_goods_stock);
}
$consignee = get_consignee($_SESSION['user_id']);
$_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
$_POST['card_message'] = isset($_POST['card_message']) ? htmlspecialchars($_POST['card_message']) : '';
$_POST['inv_type'] = !empty($_POST['inv_type']) ? htmlspecialchars($_POST['inv_type']) : '';
$_POST['inv_payee'] = isset($_POST['inv_payee']) ? htmlspecialchars($_POST['inv_payee']) : '';
$_POST['inv_content'] = isset($_POST['inv_content']) ? htmlspecialchars($_POST['inv_content']) : '';
$_POST['postscript'] = isset($_POST['postscript']) ? htmlspecialchars($_POST['postscript']) : '';
$order = array('shipping_id' => intval($_POST['shipping']), 'pay_id' => isset($_POST['payment']) ? intval($_POST['payment']) : '0', 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0, 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0, 'card_message' => trim($_POST['card_message']), 'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.0, 'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0, 'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0, 'need_inv' => empty($_POST['need_inv']) ? 0 : 1, 'inv_type' => $_POST['inv_type'], 'inv_payee' => trim($_POST['inv_payee']), 'inv_content' => $_POST['inv_content'], 'postscript' => trim($_POST['postscript']), 'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '', 'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0, 'user_id' => $_SESSION['user_id'], 'add_time' => gmtime(), 'order_status' => OS_UNCONFIRMED, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_UNPAYED, 'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district'])));
/* 扩展信息 */
if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS) {
$order['extension_code'] = $_SESSION['extension_code'];
$order['extension_id'] = $_SESSION['extension_id'];
} else {
$order['extension_code'] = '';
$order['extension_id'] = 0;
}
/* 检查积分余额是否合法 */
$user_id = $_SESSION['user_id'];
if ($user_id > 0) {
$user_info = user_info($user_id);
$order['surplus'] = min($order['surplus'], $user_info['user_money'] + $user_info['credit_line']);
if ($order['surplus'] < 0) {
$order['surplus'] = 0;
示例3: done
public function done () {
global $ecs,$db,$_CFG;
include_once(RPC_ROOT.'includes/lib_clips_ec.php');
include_once(RPC_ROOT.'includes/lib_payment.php');
/* 取得购物类型 */
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
/* 检查购物车中是否有商品 */
$sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE session_id = '" . SESS_ID . "' " .
"AND parent_id = 0 AND is_gift = 0 AND rec_type = '$flow_type'";
if ($db->getOne($sql) == 0)
{
$msg = rpcLang('flow.php', 'no_goods_in_cart');
jsonExit("{\"status\":\"$msg\"}");
}
/* 检查商品库存,如果使用库存,且下订单时减库存,则减少库存 */
if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE)
{
$cart_goods_stock = get_cart_goods();
$_cart_goods_stock = array();
foreach ($cart_goods_stock['goods_list'] as $value)
{
$_cart_goods_stock[$value['rec_id']] = $value['goods_number'];
}
zy_flow_cart_stock($_cart_goods_stock);
unset($cart_goods_stock, $_cart_goods_stock);
}
/*
* 检查用户是否已经登录
* 如果用户已经登录了则检查是否有默认的收货地址
* 如果没有登录则跳转到登录和注册页面
*/
if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0)
{
/* 用户没有登录且没有选定匿名购物,转向到登录页面 */
$msg = rpcLang('user.php', 'nologin');
jsonExit("{\"status\":\"$msg\"}");
}
$consignee = get_consignee($_SESSION['user_id']);
/* 检查收货人信息是否完整 */
if (!check_consignee_info($consignee, $flow_type))
{
$msg = rpcLang('flow.php', 'user_address_not_full');
jsonExit("{\"status\":\"$msg\"}");
}
$_GET['how_oos'] = isset($_GET['how_oos']) ? intval($_GET['how_oos']) : 0;
$_GET['card_message'] = isset($_GET['card_message']) ? htmlspecialchars($_GET['card_message']) : '';
$_GET['inv_type'] = !empty($_GET['inv_type']) ? htmlspecialchars($_GET['inv_type']) : '';
$_GET['inv_payee'] = isset($_GET['inv_payee']) ? htmlspecialchars($_GET['inv_payee']) : '';
$_GET['inv_content'] = isset($_GET['inv_content']) ? htmlspecialchars($_GET['inv_content']) : '';
$_GET['postscript'] = isset($_GET['postscript']) ? htmlspecialchars($_GET['postscript']) : '';
$referer = empty($_GET['referer']) ? 'Android':trim($_GET['referer']);
$order = array(
//'shipping_id' => intval($_POST['shipping']),
'shipping_id' => intval($_GET['shipping']),//快递id
'pay_id' => intval($_GET['payment']),//支付方式id
'pack_id' => isset($_GET['pack']) ? intval($_GET['pack']) : 0,//包装
'card_id' => isset($_GET['card']) ? intval($_GET['card']) : 0,//贺卡
'card_message' => trim($_GET['card_message']),
'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
'bonus_id' => isset($_GET['bonus']) ? intval($_GET['bonus']) : 0,
'need_inv' => empty($_POST['need_inv']) ? 0 : 1,
'postscript' => trim($_POST['postscript']),
'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '',
'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0,
'user_id' => $_SESSION['user_id'],
'add_time' => gmtime(),
'order_status' => OS_UNCONFIRMED,
'shipping_status' => SS_UNSHIPPED,
'pay_status' => PS_UNPAYED,
'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']))
);
if(EC_CHARSET == 'utf-8'){
$order['inv_type'] = gbktoutf8($_GET['inv_type']);
$order['inv_payee'] = gbktoutf8(trim($_GET['inv_payee']));
$order['inv_content'] = gbktoutf8($_GET['inv_content']);
}else{
$order['inv_type'] = utf8togbk($_GET['inv_type']);
$order['inv_payee'] = utf8togbk(trim($_GET['inv_payee']));
$order['inv_content'] = utf8togbk($_GET['inv_content']);
}
/* 扩展信息 */
if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS)
{
$order['extension_code'] = $_SESSION['extension_code'];
$order['extension_id'] = $_SESSION['extension_id'];
}
else
{
//.........这里部分代码省略.........
示例4: isset
'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0,
'need_inv' => empty($_POST['need_inv']) ? 0 : 1,
'inv_type' => $_POST['inv_type'],
'inv_payee' => trim($_POST['inv_payee']),
'inv_content' => $_POST['inv_content'],
'postscript' => trim($_POST['postscript']),
'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '',
'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0,
'user_id' => $_SESSION['user_id'],
'add_time' => gmtime(),
'order_status' => OS_UNCONFIRMED,
'shipping_status' => SS_UNSHIPPED,
'pay_status' => PS_UNPAYED,
'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']))
);
/* 扩展信息 */
if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS)
{
$order['extension_code'] = $_SESSION['extension_code'];
$order['extension_id'] = $_SESSION['extension_id'];
}
else
{
$order['extension_code'] = '';
$order['extension_id'] = 0;
}
/* 检查积分余额是否合法 */
示例5: foreach
foreach ($cart_goods_new as $ckey => $cval) {
$cart_goods = $cval['goodlist'];
$_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
$_POST['card_message'] = isset($_POST['card_message']) ? compile_str($_POST['card_message']) : '';
$_POST['inv_type'] = !empty($_POST['inv_type']) ? compile_str($_POST['inv_type']) : '';
$_POST['inv_payee'] = isset($_POST['inv_payee']) ? compile_str($_POST['inv_payee']) : '';
$_POST['inv_content'] = isset($_POST['inv_content']) ? compile_str($_POST['inv_content']) : '';
$_POST['postscript'] = isset($_POST['postscript']) ? compile_str($_POST['postscript']) : '';
$order_integral = isset($_POST['integral']) ? $_POST['integral'] : array();
$order_bonus_id = isset($_POST['bonus']) ? $_POST['bonus'] : array();
$order_bonus_sn = isset($_POST['bonus_sn']) ? $_POST['bonus_sn'] : array();
$order_surplus = isset($_POST['surplus']) ? $_POST['surplus'] : array();
$_POST['vat_invoice'] = isset($_POST['vat_invoice']) ? compile_str($_POST['vat_invoice']) : '';
$_POST['normal_invoice'] = isset($_POST['normal_invoice']) ? compile_str($_POST['normal_invoice']) : '';
//$_POST['danwei'] = isset($_POST['danwei']) ? compile_str($_POST['danwei']) : '';
$order = array('shipping_id' => intval($_POST['shipping']), 'pay_id' => intval($_POST['payment']), 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0, 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0, 'card_message' => trim($_POST['card_message']), 'surplus' => isset($order_surplus[$ckey]) ? floatval($order_surplus[$ckey]) : 0.0, 'integral' => isset($order_integral[$ckey]) ? intval($order_integral[$ckey]) : 0, 'bonus_id' => isset($order_bonus_id[$ckey]) ? intval($order_bonus_id[$ckey]) : 0, 'need_inv' => empty($_POST['need_inv']) ? 0 : 1, 'postscript' => trim($_POST['postscript']), 'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '', 'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0, 'user_id' => $_SESSION['user_id'], 'add_time' => gmtime(), 'order_status' => OS_UNCONFIRMED, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_UNPAYED, 'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district'])), 'supplier_id' => $ckey, 'need_inv' => 1, 'inv_content' => $_POST['cont'], 'vat_inv_company_name' => $_POST['vat_inv_company_name'], 'vat_inv_taxpayer_id' => $_POST['vat_inv_taxpayer_id'], 'vat_inv_registration_address' => $_POST['vat_inv_registration_address'], 'vat_inv_registration_phone' => $_POST['vat_inv_registration_phone'], 'vat_inv_deposit_bank' => $_POST['vat_inv_deposit_bank'], 'vat_inv_bank_account' => $_POST['vat_inv_bank_account'], 'inv_consignee_name' => $_POST['inv_consignee_name'], 'inv_consignee_phone' => $_POST['inv_consignee_phone'], 'inv_consignee_country ' => '1', 'inv_consignee_province' => $_POST['inv_consignee_province'], 'inv_consignee_city' => $_POST['selCities'], 'inv_consignee_district' => $_POST['selDistricts'], 'inv_consignee_address' => $_POST['inv_consignee_address']);
if ($_POST['normal_invoice']) {
$order['inv_type'] = $_POST['normal_invoice'];
if ($_POST['danwei']) {
$order['inv_payee'] = $_POST['danwei'];
} else {
$order['inv_payee'] = '个人';
}
$order['inv_payee_type'] = $_POST['oadio'];
$order['inv_payee_type'] = 'individual';
} else {
$order['inv_type'] = $_POST['vat_invoice'];
}
/* 扩展信息 */
if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS) {
$order['extension_code'] = $_SESSION['extension_code'];