Просмотр исходного кода

Merge branch 'master' of https://git.bjtdba.com/shop/php

chengzhiyixia 1 год назад
Родитель
Сommit
3b34e87a39

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

@@ -1967,7 +1967,7 @@ class StoreOrderRepository extends BaseRepository
1967 1967
      * @author xaboy
1968 1968
      * @day 2020/6/9
1969 1969
      */
1970
-    public function cartIdByOrderInfo($uid, array $cartId, int $addressId = null, $confirm = true, $psType = true, $payType = 0, $youhui_price_key = '',$is_commercetrade=0)
1970
+    public function cartIdByOrderInfo($uid, array $cartId, int $addressId = null, $confirm = true, $psType = true, $payType = 0, $youhui_price_key = '')
1971 1971
     {
1972 1972
         $address = null;
1973 1973
         if ($psType) {//是否需要地址
@@ -2360,63 +2360,63 @@ class StoreOrderRepository extends BaseRepository
2360 2360
                     ['type' => 'c1', 'price' => $orderpri, 'other' => 0, 'note' => "复购金"],
2361 2361
                 ];
2362 2362
 
2363
-            }// 商贸区
2364
-            elseif ($is_commercetrade){
2363
+            } else{
2364
+                // 商贸区
2365
+                /** @var \app\common\repositories\merchant\MerchantRepository $merchant */
2366
+                $merchant = app()->make(MerchantRepository::class);
2367
+                $merchantInfo = $merchant->get($store_product_datas['mer_id']);
2368
+                // 1企业2个体3个人
2369
+                if ($merchantInfo && in_array($merchantInfo['type'],[2,3])) {
2370
+                    $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
2371
+                    $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
2372
+                    if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2373
+                        $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
2374
+                        $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
2375
+                        $srtArry['jfduihuan'] = $jf;
2376
+                        $srtArry['jdduihuan'] = $jd;
2377
+                        $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
2378
+                        $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
2379
+
2380
+                        $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2381
+                        $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
2382
+                        $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2383
+                        $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
2384
+                        $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2385
+                        $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
2386
+                        $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2387
+                        $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
2388
+
2389
+                        //var_dump($cartInfo['list'][$_k]);
2390
+                        //支付组合
2391
+                        // $fzone_paytype= [
2392
+
2393
+                        //     2=>[
2394
+                        //         1=>[$jcvr,$jcjf],//VR+积分
2395
+                        //         2=>[$jcprice,$jcjf1],//现金+积分
2396
+                        //         3=>[$jcvr1,$jcjd],//VR+京豆
2397
+                        //         4=>[$jcprice1,$jcjd1],//现金+金豆
2398
+                        //         5=>$orderpri,//VR
2399
+                        //         6=>$orderpri,//现金
2400
+                        //     ]
2401
+                        // ];
2365 2402
 
2366
-                $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
2367
-                $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
2368
-                if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2369
-                    $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
2370
-                    $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
2371
-                    $srtArry['jfduihuan'] = $jf;
2372
-                    $srtArry['jdduihuan'] = $jd;
2373
-                    $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
2374
-                    $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
2375
-
2376
-                    $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2377
-                    $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
2378
-                    $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2379
-                    $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
2380
-                    $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2381
-                    $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
2382
-                    $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2383
-                    $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
2384
-
2385
-                    //var_dump($cartInfo['list'][$_k]);
2386
-                    //支付组合
2387
-                    // $fzone_paytype= [
2388
-
2389
-                    //     2=>[
2390
-                    //         1=>[$jcvr,$jcjf],//VR+积分
2391
-                    //         2=>[$jcprice,$jcjf1],//现金+积分
2392
-                    //         3=>[$jcvr1,$jcjd],//VR+京豆
2393
-                    //         4=>[$jcprice1,$jcjd1],//现金+金豆
2394
-                    //         5=>$orderpri,//VR
2395
-                    //         6=>$orderpri,//现金
2396
-                    //     ]
2397
-                    // ];
2398
-
2399
-                    $cartInfo['list'][$_k]['fzone_paytype'] = [
2400
-
2401
-                        // ['type'=>'a1','price'=>100,'other'=>0,'note'=>"VR"],
2402
-                        // ['type'=>'a2','price'=>100,'other'=>0,"note"=>"现金"],
2403
-                        // ['type'=>'a3','price'=>0,'other'=>0,"note"=>"现金+VR"],
2403
+                        $cartInfo['list'][$_k]['fzone_paytype'] = [
2404
+                            // ['type'=>'a1','price'=>100,'other'=>0,'note'=>"VR"],
2405
+                            // ['type'=>'a2','price'=>100,'other'=>0,"note"=>"现金"],
2406
+                            // ['type'=>'a3','price'=>0,'other'=>0,"note"=>"现金+VR"],
2404 2407
 
2405 2408
 //                        ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2406
-                        ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2407
-                        // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2408
-                        ['type'=>'b4','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2409
+                            ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2410
+                            // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2411
+                            ['type'=>'b4','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2409 2412
 //                        ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2410
-                        ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2411
-
2412
-                        // ['type'=>'c1','price'=>100,'other'=>0,'note'=>"复购金"],
2413
-                        // ['type'=>'c2','price'=>100,'other'=>0,"note"=>"VR"],
2414
-                        // ['type'=>'c3','price'=>100,'other'=>0,"note"=>"现金"],
2415
-
2416
-
2417
-                    ];
2418
-
2413
+                            ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2419 2414
 
2415
+                            // ['type'=>'c1','price'=>100,'other'=>0,'note'=>"复购金"],
2416
+                            // ['type'=>'c2','price'=>100,'other'=>0,"note"=>"VR"],
2417
+                            // ['type'=>'c3','price'=>100,'other'=>0,"note"=>"现金"],
2418
+                        ];
2419
+                    }
2420 2420
                 }
2421 2421
             }
2422 2422
 

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

@@ -70,13 +70,12 @@ 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);
74 73
         $psType = $this->request->param('type',true);//是否需要地址 boolean
75 74
         $uid = $this->request->uid();
76 75
 
77 76
         if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
78 77
             return app('json')->fail('已失效或已下单');
79
-        $orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId,true,$psType,'','',$is_commercetrade);
78
+        $orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId,true,$psType);
80 79
         $orderInfo['product_type']=0;
81 80
         if($this->source=='yhc'){
82 81
             $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');