Browse Source

创建门店

shish 10 months ago
parent
commit
7c9418aac3

+ 8 - 2
app-ghs/controllers/IntraCityController.php

@@ -61,13 +61,16 @@ class IntraCityController extends BaseController
         $adminId = $this->adminId;
         util::checkRepeatCommit($adminId, 3);
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : $shop->city;
+
         $storeData = [
             'out_store_id' => $this->mainId, //自定义门店编号
             'store_name' => $name,
             'address_info' => [
                 'province' => $shop->province,
                 'city' => $shop->city,
-                'area' => $shop->dist,
+                'area' => $dist,
                 'street' => '',
                 'house' => $shop->address . $shop->floor,
                 'lat' => $shop->lat,
@@ -157,6 +160,9 @@ class IntraCityController extends BaseController
             util::fail('地址缺失,请修改');
         }
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : $shop->city;
+
         $storeData = [
             'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
@@ -164,7 +170,7 @@ class IntraCityController extends BaseController
                 'address_info' => [
                     'province' => $shop->province,
                     'city' => $shop->city,
-                    'area' => $shop->dist,
+                    'area' => $dist,
                     'street' => '',
                     'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,

+ 7 - 2
app-hd/controllers/IntraCityController.php

@@ -58,13 +58,15 @@ class IntraCityController extends BaseController
         if (empty($shop->address)) {
             util::fail('地址缺失,请修改');
         }
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : $shop->city;
         $storeData = [
             'out_store_id' => $this->mainId, //自定义门店编号 --  从 shopId 改为 mainId
             'store_name' => $name,
             'address_info' => [
                 'province' => $shop->province,
                 'city' => $shop->city,
-                'area' => $shop->dist,
+                'area' => $dist,
                 'street' => '',
                 'house' => $shop->address . $shop->floor,
                 'lat' => $shop->lat,
@@ -156,6 +158,9 @@ class IntraCityController extends BaseController
         $sjName = $shop->merchantName ?? '';
         $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : $shop->city;
+
         $storeData = [
             'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
@@ -163,7 +168,7 @@ class IntraCityController extends BaseController
                 'address_info' => [
                     'province' => $shop->province,
                     'city' => $shop->city,
-                    'area' => $shop->dist,
+                    'area' => $dist,
                     'street' => '',
                     'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,