shish hai 7 meses
pai
achega
706fa4dfa1

+ 2 - 1
app-ghs/controllers/ExpressController.php

@@ -37,7 +37,8 @@ class ExpressController extends BaseController
     // 获取字典中的 hasMap
     public function actionGetHasMap()
     {
-        util::success(['hasMap' => dict::getDict('hasMap')]);
+        $shop = $this->shop;
+        util::success(['hasMap' => dict::getDict('hasMap'), 'shop' => $shop]);
     }
 
     //获取采购单物流运单的轨迹 ssh 20250705

+ 25 - 3
app-ghs/controllers/OrderController.php

@@ -1089,7 +1089,7 @@ class OrderController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉开单售后控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960, 28456, 31105, 28456, 31105, 52528, 25011, 61449,77951])) {
+                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960, 28456, 31105, 28456, 31105, 52528, 25011, 61449, 77951])) {
                     util::fail('你不能开单哦');
                 }
             }
@@ -1368,9 +1368,9 @@ class OrderController extends BaseController
 
                 //跑腿订单生产者创建订单
                 // TODO
-                if($sendType == dict::getDict('sendType', 'thirdSend') && $post['callErrand'] == 1){ // $post 中有 pickupTime,则说明是要立即发跑腿 或者  callErrand == 1
+                if ($sendType == dict::getDict('sendType', 'thirdSend') && $post['callErrand'] == 1) { // $post 中有 pickupTime,则说明是要立即发跑腿 或者  callErrand == 1
                     $payWay = $post['payWay'];
-                    if($hasPay != dict::getDict('hasPay', 'unPay')){
+                    if ($hasPay != dict::getDict('hasPay', 'unPay')) {
                         $data = [
                             'orderId' => $saleId,
                         ];
@@ -3019,6 +3019,12 @@ class OrderController extends BaseController
         if ($order->mainId != $this->mainId) {
             util::fail('不是你的订单,不能修改地址');
         }
+        if ($order->status == 3) {
+            util::fail('订单已经在配送了,不能修改地址');
+        }
+        if ($order->status == 4) {
+            util::fail('订单已完成,不能修改地址');
+        }
         $province = $post['province'] ?? '';
         $city = $post['city'] ?? '';
         $dist = $post['dist'] ?? '';
@@ -3038,6 +3044,22 @@ class OrderController extends BaseController
         $order->lat = $lat;
         $order->long = $long;
         $order->save();
+        if ($post['syncDefaultAddress'] == 1) {
+            $customId = $order->customId ?? 0;
+            $custom = CustomClass::getById($customId, true);
+            if (!empty($custom)) {
+                $custom->province = $province;
+                $custom->city = $city;
+                $custom->dist = $dist;
+                $custom->address = $address;
+                $custom->floor = $floor;
+                $custom->showAddress = $showAddress;
+                $custom->fullAddress = $fullAddress;
+                $custom->lat = $lat;
+                $custom->long = $long;
+                $custom->save();
+            }
+        }
         util::complete('修改成功');
     }
 

+ 2 - 1
app-hd/controllers/ExpressController.php

@@ -65,7 +65,8 @@ class ExpressController extends BaseController
     // 获取字典中的 hasMap
     public function actionGetHasMap()
     {
-        util::success(['hasMap' => dict::getDict('hasMap')]);
+        $shop = $this->shop;
+        util::success(['hasMap' => dict::getDict('hasMap'), 'shop' => $shop]);
     }
 
     // 配送详情