Explorar o código

订单检查接口新增是否商贸区字段

family hai 1 ano
pai
achega
2f1147a495

+ 24 - 16
app/common/repositories/store/order/StoreOrderRepository.php

@@ -1963,7 +1963,7 @@ class StoreOrderRepository extends BaseRepository
1963 1963
      * @author xaboy
1964 1964
      * @day 2020/6/9
1965 1965
      */
1966
-    public function cartIdByOrderInfo($uid, array $cartId, int $addressId = null, $confirm = true, $psType = true, $payType = 0, $youhui_price_key = '')
1966
+    public function cartIdByOrderInfo($uid, array $cartId, int $addressId = null, $confirm = true, $psType = true, $payType = 0, $youhui_price_key = '',$is_commercetrade=0)
1967 1967
     {
1968 1968
         $address = null;
1969 1969
         if ($psType) {//是否需要地址
@@ -2286,7 +2286,7 @@ class StoreOrderRepository extends BaseRepository
2286 2286
                 }
2287 2287
 
2288 2288
 
2289
-            } else if ($store_product_datas['mer_id'] == 439) {
2289
+            } else if ($store_product_datas['mer_id'] == 439 || $is_commercetrade) {
2290 2290
 
2291 2291
 
2292 2292
                 //精彩生活和商贸区
@@ -2323,25 +2323,33 @@ class StoreOrderRepository extends BaseRepository
2323 2323
                     //     ]
2324 2324
                     // ];
2325 2325
 
2326
-                    $cartInfo['list'][$_k]['fzone_paytype'] = [
2326
+                    if ($is_commercetrade){
2327
+                        $cartInfo['list'][$_k]['fzone_paytype'] = [
2328
+                            ['type' => 'commercetrade_cash_integral', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2329
+                            ['type'=>'commercetrade_peking_bean','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2330
+                            ['type' => 'commercetrade_cash', 'price' => $orderpri, 'other' => 0, "note" => "现金"]
2331
+                        ];
2332
+                    } else {
2333
+                        $cartInfo['list'][$_k]['fzone_paytype'] = [
2327 2334
 
2328
-                        // ['type'=>'a1','price'=>100,'other'=>0,'note'=>"VR"],
2329
-                        // ['type'=>'a2','price'=>100,'other'=>0,"note"=>"现金"],
2330
-                        // ['type'=>'a3','price'=>0,'other'=>0,"note"=>"现金+VR"],
2335
+                            // ['type'=>'a1','price'=>100,'other'=>0,'note'=>"VR"],
2336
+                            // ['type'=>'a2','price'=>100,'other'=>0,"note"=>"现金"],
2337
+                            // ['type'=>'a3','price'=>0,'other'=>0,"note"=>"现金+VR"],
2331 2338
 
2332
-                        ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2333
-                        ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2334
-                        // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2335
-                        //['type'=>'b4','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2336
-                        ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2337
-                        ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2339
+                            ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2340
+                            ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2341
+                            // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2342
+                            //['type'=>'b4','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2343
+                            ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2344
+                            ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2338 2345
 
2339
-                        // ['type'=>'c1','price'=>100,'other'=>0,'note'=>"复购金"],
2340
-                        // ['type'=>'c2','price'=>100,'other'=>0,"note"=>"VR"],
2341
-                        // ['type'=>'c3','price'=>100,'other'=>0,"note"=>"现金"],
2346
+                            // ['type'=>'c1','price'=>100,'other'=>0,'note'=>"复购金"],
2347
+                            // ['type'=>'c2','price'=>100,'other'=>0,"note"=>"VR"],
2348
+                            // ['type'=>'c3','price'=>100,'other'=>0,"note"=>"现金"],
2342 2349
 
2343 2350
 
2344
-                    ];
2351
+                        ];
2352
+                    }
2345 2353
 
2346 2354
 
2347 2355
                 }

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

@@ -70,12 +70,13 @@ class StoreOrder extends BaseController
70 70
     {
71 71
         $cartId = (array)$this->request->param('cart_id', []);
72 72
         $addressId = (int)$this->request->param('address_id');
73
+        $is_commercetrade = (int)$this->request->param('is_commercetrade',0);
73 74
         $psType = $this->request->param('type',true);//是否需要地址 boolean
74 75
         $uid = $this->request->uid();
75 76
 
76 77
         if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
77 78
             return app('json')->fail('已失效或已下单');
78
-        $orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId,true,$psType);
79
+        $orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId,true,$psType,'',$is_commercetrade);
79 80
         $orderInfo['product_type']=0;
80 81
         if($this->source=='yhc'){
81 82
             $product_type=Db::name('store_cart')->alias('c')->join('store_product p','c.product_id=p.product_id')->whereIn('cart_id',$cartId)->column('p.type');