Forráskód Böngészése

Merge branch 'master' of e.coding.net:zdap/weixiu/weixiu_api into new_settlement-m

liugc 11 hónapja
szülő
commit
bd46321761

+ 12 - 1
app/adminapi/controller/group_activity/GroupOrderController.php

@@ -65,5 +65,16 @@ class GroupOrderController extends BaseAdminController
         return $this->data($result);
     }
 
-
+    /**
+     * @notes 编辑拼团订单
+     * @return \think\response\Json
+     * @author likeadmin
+     * @date 2025/03/13 10:31
+     */
+    public function edit()
+    {
+        $params = (new GroupOrderValidate())->post()->goCheck('edit');
+        $result = GroupOrderLogic::edit($params);
+        return $this->data($result);
+    }
 }

+ 14 - 0
app/adminapi/logic/group_activity/GroupOrderLogic.php

@@ -70,4 +70,18 @@ class GroupOrderLogic extends BaseLogic
         }
         return $detail->toArray();
     }
+
+    /**
+     * @notes 编辑团购订单
+     * @return array
+     */
+    public static function edit($params) 
+    {
+        $detail = GroupOrder::findOrEmpty($params['id']);
+        if (!$detail->isEmpty()) {
+            $detail->end_time = strtotime($params['end_time']);
+            $detail->save();
+        }
+        return $detail->toArray();
+    }
 }

+ 5 - 0
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -1078,6 +1078,11 @@ class ServiceWorkLogic extends BaseLogic
     public static function addThirdPlatformsOrders($params)
     {
         try {
+            if($params['userAddress']){
+                $lon_lat = get_address_lat_lng($params['userAddress']);
+                $params['lon'] = $lon_lat['lon'];
+                $params['lat'] = $lon_lat['lat'];
+            }
             return ThirdOrderLogic::submitOrders($params);
         }catch  (\Exception $e) {
             self::setError($e->getMessage());

+ 10 - 0
app/adminapi/validate/group_activity/GroupOrderValidate.php

@@ -66,4 +66,14 @@ class GroupOrderValidate extends BaseValidate
         return $this->only(['id']);
     }
 
+    /**
+     * @notes 编辑场景
+     * @author likeadmin
+     * @date 2025/03/13 10:31
+     */
+    public function sceneEdit()
+    {
+        return $this->only(['id','end_time']);
+    }
+
 }