private static function _get_distruct_name($city, $district) { $hash = MES_Fee::get_fee_region(); if ($hash[$city] && $city) { if ($hash[$city][$district]) { return $hash[$city][$district]['name']; } } return ''; }
public static function cal_fee($city, $district) { $hash = MES_Fee::get_fee_region(); if ($hash[$city]) { if ($hash[$city][$district]) { return !$hash[$city][$district]['free']; } } else { return false; } }
public static function save_consignee($consignee) { include_once 'includes/check_order.php'; include_once 'includes/lib_order.php'; if ($_SESSION['user_id'] > 0) { include_once ROOT_PATH . 'includes/lib_transaction.php'; /* 如果用户已经登录,则保存收货人信息 */ $consignee['user_id'] = $_SESSION['user_id']; } //收货人信息保存到session $_SESSION['flow_consignee'] = stripslashes_deep($consignee); $result = array('code' => RES_SUCCSEE, 'message' => '', 'content' => ''); $cart_goods = cart_goods(0); //有二级城市 就必须要选择 否则返回错误 $fee_city_hash = MES_Fee::get_fee_region(); $city = $consignee['city']; if ($fee_city_hash[$city] && !$consignee['district']) { $result['code'] = RES_FAIL; return json_encode($result); } //在服务器检查订单是否合法 $meg = check_order($consignee, $cart_goods); if ($meg) { $result['code'] = 2; $result['message'] = $meg; return json_encode($result); } $result['data'] = $consignee; return json_encode($result); }