Selaa lähdekoodia

精彩生活区要现金加京豆vr加京豆支付商贸区要现金加京豆支付

sunxbiao 1 vuosi sitten
vanhempi
commit
f134f269e1

+ 26 - 11
app/common/repositories/store/order/StoreOrderRepository.php

@@ -939,18 +939,33 @@ class StoreOrderRepository extends BaseRepository
939 939
 
940 940
 
941 941
                         } else if (!empty($array_fzone_paytype['type'] == 'b3')) {
942
-                            //精彩生活区 VR+京豆
942
+                            //精彩生活区 || 商贸区 VR+京豆
943
+
944
+//                            $groupOrder['er'] = 1;
945
+//                            $groupOrder['er1'] = "开发中升级中!";
946
+
947
+                            //vr+积分
948
+                            $vrpri = $userdatas['vr'] - $array_fzone_paytype['price'];
949
+                            $pricepri = $userdatas['jingdou'] - $array_fzone_paytype['other'];
950
+
943 951
 
952
+                            //vr+京豆
953
+                            if ($vrpri >= 0 && $pricepri >= 0) {
954
+                                Db::name("user")->where("uid", $uid)->update(['vr' => $vrpri, 'jingdou' => $pricepri]);
955
+                                //修改订单状态
956
+                                Db::name("store_order")->where("order_id", $_order->order_id)->update(['paid' => 1, 'pay_time' => date('Y-m-d H:i:s'), 'status' => 0, 'douhuomall' => 1, 'douhuomall_status' => 9]);
957
+                                Db::name("store_group_order")->where("group_order_id", $groupOrder->group_order_id)->update(['paid' => 1, 'pay_time' => date('Y-m-d H:i:s')]);
944 958
 
945
-                            $groupOrder['er'] = 1;
946
-                            $groupOrder['er1'] = "开发中升级中!";
959
+                                $paystage_status = 1;
960
+
961
+                            }
947 962
 
948 963
                         } else if (!empty($array_fzone_paytype['type'] == 'b4')) {
949 964
                             //精彩生活区 VR+京豆
950 965
 
951 966
 
952
-                            $groupOrder['er'] = 1;
953
-                            $groupOrder['er1'] = "开发中升级中!";
967
+//                            $groupOrder['er'] = 1;
968
+//                            $groupOrder['er1'] = "开发中升级中!";
954 969
 
955 970
                         } else if (!empty($array_fzone_paytype['type'] == 'b5')) {
956 971
                             //精彩生活 VR支付
@@ -2328,8 +2343,8 @@ class StoreOrderRepository extends BaseRepository
2328 2343
 
2329 2344
                         ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2330 2345
                         ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2331
-                        // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2332
-                        //['type'=>'b4','price'=>$jcvr1,'other'=>$jcjd,"note"=>"现金+京豆"],
2346
+                        ['type' => 'b3', 'price' => $jcvr1, 'other' => $jcjd, "note" => "VR+京豆"],
2347
+                        ['type' => 'b4', 'price' => $jcvr1, 'other' => $jcjd, "note" => "现金+京豆"],
2333 2348
                         ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2334 2349
                         ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2335 2350
 
@@ -2400,11 +2415,11 @@ class StoreOrderRepository extends BaseRepository
2400 2415
                             // ['type'=>'a2','price'=>100,'other'=>0,"note"=>"现金"],
2401 2416
                             // ['type'=>'a3','price'=>0,'other'=>0,"note"=>"现金+VR"],
2402 2417
 
2403
-//                        ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2418
+                            //                        ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
2404 2419
                             ['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
2405
-                            // ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
2406
-//                            ['type' => 'b4', 'price' => $jcvr1, 'other' => $jcjd, "note" => "现金+京豆"],
2407
-//                        ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2420
+//                            ['type' => 'b3', 'price' => $jcvr1, 'other' => $jcjd, "note" => "VR+京豆"],
2421
+                            ['type' => 'b4', 'price' => $jcvr1, 'other' => $jcjd, "note" => "现金+京豆"],
2422
+                            //                        ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
2408 2423
                             ['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
2409 2424
 
2410 2425
                             // ['type'=>'c1','price'=>100,'other'=>0,'note'=>"复购金"],

+ 34 - 0
app/controller/api/Notify.php

@@ -794,6 +794,40 @@ class Notify
794 794
                                     $note_arr = ["uid"=>$user_data['uid'],"msg"=>"数据异常","fzone_paytype"=>$store_order_data['fzone_paytype']];
795 795
                                     Db::name("test_log")->insert(['create_time'=>date('Y-m-d H:i:s'),'note'=>json_encode($note_arr, JSON_UNESCAPED_UNICODE)]);
796 796
                                 }
797
+                            } else if($array_fzone_paytype['type']=='b4'){
798
+                                if(!empty($array_fzone_paytype['other']) && is_numeric($array_fzone_paytype['other']) == true){
799
+                                    $jdpri = $user_data['jingdou'] -  $array_fzone_paytype['other'];
800
+
801
+                                    // 现金+京豆
802
+                                    if($jdpri  >= 0 ){
803
+                                        Db::name("user")->where("uid", $user_data['uid'])->update(['jingdou'=>$jdpri]);
804
+                                        //消费京豆日志
805
+                                        $log_data = [
806
+                                            "uid" => $user_data['uid'],
807
+                                            "reward_socre" => $array_fzone_paytype['other'],
808
+                                            "addtime" => time(),
809
+                                            "status" => 1,
810
+                                            "order_id" => $store_order_data['order_id'],
811
+                                            "mark" => "购买" . $wenan . "商品消费京豆",
812
+                                            "surplus" => $jdpri,
813
+                                            "pm" => 2,
814
+                                            "source_type" => 5
815
+                                        ];
816
+                                        Db::name("user_sign_score")->insert($log_data);
817
+                                    }else{
818
+                                        $note_arr = [
819
+                                            "uid"=>$user_data['uid'],
820
+                                            "dec_score"=>$array_fzone_paytype['other'],
821
+                                            "rem_score"=>$user_data['score'],
822
+                                            "msg"=>"京豆不足",
823
+                                            "fzone_paytype"=>$store_order_data['fzone_paytype']
824
+                                        ];
825
+                                        Db::name("test_log")->insert(['create_time'=>date('Y-m-d H:i:s'),'note'=>json_encode($note_arr, JSON_UNESCAPED_UNICODE)]);
826
+                                    }
827
+                                }else{
828
+                                    $note_arr = ["uid"=>$user_data['uid'],"msg"=>"数据异常","fzone_paytype"=>$store_order_data['fzone_paytype']];
829
+                                    Db::name("test_log")->insert(['create_time'=>date('Y-m-d H:i:s'),'note'=>json_encode($note_arr, JSON_UNESCAPED_UNICODE)]);
830
+                                }
797 831
                             }
798 832
                             //end 现金+积分
799 833
 

+ 12 - 4
app/controller/api/store/order/StoreOrder.php

@@ -487,15 +487,23 @@ class StoreOrder extends BaseController
487 487
 
488 488
             }else if(!empty($array_fzone_paytype['type'] == 'b3')){
489 489
                 //精彩生活区 VR+京豆
490
-
491
-
492
-                return app('json')->fail("开发中升级中!");
490
+                $vrpri = $userdatas['vr'] -  $array_fzone_paytype['price'];
491
+                $pricepri = $userdatas['jingdou'] -  $array_fzone_paytype['other'];
492
+                //vr+积分
493
+                if($vrpri < 0 || $pricepri < 0){
494
+                    return app('json')->fail("支付失败,VR或京豆不足!");
495
+                }
493 496
 
494 497
             }else if(!empty($array_fzone_paytype['type'] == 'b4')){
495 498
                 //精彩生活区 VR+京豆
499
+                $pricepri = $userdatas['jingdou'] -  $array_fzone_paytype['other'];
496 500
 
501
+                // //现金+积分
502
+                if($pricepri  < 0 ){
503
+                    return app('json')->fail("支付失败,京豆不足!");
504
+                }
497 505
 
498
-                return app('json')->fail("开发中升级中!");
506
+//                return app('json')->fail("开发中升级中!");
499 507
 
500 508
             }else if(!empty($array_fzone_paytype['type'] == 'b5')){
501 509
                 //精彩生活 VR支付