From 5143490563111c2efe12379e819790f072651a46 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Tue, 23 Aug 2022 17:08:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=88=A4=E6=96=AD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=81=E5=8E=BB=E9=99=A4=E4=B8=8B=E5=8D=95=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/BuyService.php | 15 --------------- public/core.php | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/app/service/BuyService.php b/app/service/BuyService.php index 262359080..56e8c9465 100755 --- a/app/service/BuyService.php +++ b/app/service/BuyService.php @@ -1591,21 +1591,6 @@ class BuyService */ private static function OrderAddressInsert($order_id, $user_id, $address) { - // 坐标处理 - if(in_array(APPLICATION_CLIENT_TYPE, MyConfig('shopxo.coordinate_transformation'))) - { - // 坐标转换 火星(高德,谷歌,腾讯坐标) 转 百度 - if(isset($address['lng']) && isset($address['lat'])) - { - $map = \base\GeoTransUtil::GcjToBd($address['lng'], $address['lat']); - if(isset($map['lng']) && isset($map['lat'])) - { - $address['lng'] = $map['lng']; - $address['lat'] = $map['lat']; - } - } - } - // 订单收货地址 $data = [ 'order_id' => $order_id, diff --git a/public/core.php b/public/core.php index 4e2170f5d..5337aca63 100755 --- a/public/core.php +++ b/public/core.php @@ -61,15 +61,20 @@ if(empty($_SERVER['HTTP_HOST'])) // 查看是几级域名 $arr = explode('.', $main_domain); $len = count($arr); - // 判断是否是双后缀 - $preg = '/[\w].+\.(com|net|org|gov|edu|ac|bj|sh|tj|cq|he|sn|sx|nm|ln|jl|hl|js|zj|ah|fj|jx|sd|ha|hb|hn|gd|gx|hi|sc|gz|yn)\.cn$/'; - if($len > 2 && preg_match($preg, $main_domain)) + if($len < 2) { - // 双后缀取后3位 - $main_domain = $arr[$len-3].'.'.$arr[$len-2].'.'.$arr[$len-1]; + $main_domain = ''; } else { - // 非双后缀取后两位 - $main_domain = $arr[$len-2].'.'.$arr[$len-1]; + // 判断是否是双后缀 + $preg = '/[\w].+\.(com|net|org|gov|edu|ac|bj|sh|tj|cq|he|sn|sx|nm|ln|jl|hl|js|zj|ah|fj|jx|sd|ha|hb|hn|gd|gx|hi|sc|gz|yn)\.cn$/'; + if($len > 2 && preg_match($preg, $main_domain)) + { + // 双后缀取后3位 + $main_domain = $arr[$len-3].'.'.$arr[$len-2].'.'.$arr[$len-1]; + } else { + // 非双后缀取后两位 + $main_domain = $arr[$len-2].'.'.$arr[$len-1]; + } } } define('__MY_MAIN_DOMAIN__', $main_domain);