Quellcode durchsuchen

优化用户下单方法-进行中

sunxbiao vor 11 Monaten
Ursprung
Commit
9e540fd2cf

+ 1 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -12104,7 +12104,7 @@ class StoreOrderRepository extends BaseRepository
12104 12104
         } catch (DbException $e) {
12105 12105
             Db::rollback();
12106 12106
         }
12107
-        return [];
12107
+        return ['order_id' => $storeGroupOrderEntity->getGroupOrderId(), 'groupOrder' => $storeGroupOrderEntity->toArray()];
12108 12108
 
12109 12109
     }
12110 12110
 

+ 7 - 1
app/controller/api/store/order/StoreOrder.php

@@ -115,6 +115,13 @@ class StoreOrder
115 115
      */
116 116
     public function createOrder(StoreCartRepository $cartRepository)
117 117
     {
118
+        $uid = $this->request->uid();
119
+        if (in_array($uid, [1592, 766])) {
120
+            $request = request();
121
+            $storeOrderCreateValidate = new StoreOrderCreateValidate($request);
122
+            return $this->createOrderNew($storeOrderCreateValidate);
123
+        }
124
+
118 125
         $cartId = (array)$this->request->param('cart_id', []);
119 126
 
120 127
         //在提交订单之前会产出购物车cartid,其中会产生购买的数量,现在默认会员专区是只让购买一个商品,需要修改值为1
@@ -159,7 +166,6 @@ class StoreOrder
159 166
         $distribution_mode = $this->request->param('distribution_mode','1');//配送方式
160 167
         $ziti_address = $this->request->param('distribution_address','');//自提地址
161 168
         $youhui_price_key = $this->request->param('youhui_price_key','');//优惠key
162
-        $uid = $this->request->uid();
163 169
         $gong = app()->make(ProductAttrValueRepository::class);
164 170
 
165 171
         $allParams = input();

+ 1 - 1
app/validate/CommonValidate.php

@@ -2,7 +2,7 @@
2 2
 
3 3
 namespace app\validate;
4 4
 
5
-use app\Request;
5
+use think\facade\Request;
6 6
 use think\Validate;
7 7
 
8 8
 class CommonValidate extends Validate