mac 8 hours ago
parent
commit
0a61eac9d7
2 changed files with 83 additions and 76 deletions
  1. 76 76
      app/business/GoodsBusiness.php
  2. 7 0
      app/controller/UserController.php

+ 76 - 76
app/business/GoodsBusiness.php

@@ -444,82 +444,82 @@
 
                 $payorder = Db::table('wa_payorder')->where('id', $payorderId)->first();
 
-                if ($payorder->pay_type == 1) {
-                    $data = PayorderBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
-                    Log::channel('payment')->info('拉丁支付', $data);
-                    if (Arr::get($data, 'data.code') != 200) {
-                        throw new \Exception('通道未开通!');
-                    }
-                    $arr = [
-                        'type'       => 2,
-                        'url'        => Arr::get($data, 'data.attrData.payUrl'),
-                        'payOrderId' => ''
-                    ];
-                } elseif ($payorder->pay_type == 2) {
-                    $data = PayTwoBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
-                    Log::channel('payment')->info('桥头支付支付', $data);
-                    if (Arr::get($data, 'data.retCode') != 'SUCCESS') {
-                        throw new \Exception('调用支付失败!');
-                    }
-                    $arr = [
-                        'type'       => 2,
-                        'url'        => Arr::get($data, 'data.payParams.payUrl'),
-                        'payOrderId' => ''
-                    ];
-                }elseif ($payorder->pay_type == 3) {
-                    $data = PayThreeBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
-                    Log::channel('payment')->info('林北支付支付', $data);
-                    if (Arr::get($data, 'data.code') != 1000) {
-                        throw new \Exception('通道未开通!');
-                    }
-                    $arr = [
-                        'type'       => 2,
-                        'url'        => Arr::get($data, 'data.data.message.url'),
-                        'payOrderId' => ''
-                    ];
-                }elseif ($payorder->pay_type == 4){
-                    $data = PayorderBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
-                    Log::channel('payment')->info('西门支付', $data);
-                    if (Arr::get($data, 'data.code') != 200) {
-                        throw new \Exception('通道未开通!');
-                    }
-                    $arr = [
-                        'type'       => 2,
-                        'url'        => Arr::get($data, 'data.attrData.payUrl'),
-                        'payOrderId' => ''
-                    ];
-                }elseif ($payorder->pay_type == 5) {
-                    $data = PayFiveBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
-                    Log::channel('payment')->info('鸿运支付支付', $data);
-                    if (Arr::get($data, 'data.retCode') != 'SUCCESS') {
-                        throw new \Exception('调用支付失败!');
-                    }
-                    $arr = [
-                        'type'       => 2,
-                        'url'        => Arr::get($data, 'data.payParams.payUrl'),
-                        'payOrderId' => ''
-                    ];
-                }elseif ($payorder->pay_type == 0) {
-                    $arr = [
-                        'type'       => 3,
-                        'url'        => '',
-                        'payOrderId' => $payorder->order_no,
-                    ];
-                } else {
-                    $arr = [
-                        'type'       => 1,
-                        'url'        => '',
-                        'payOrderId' => ''
-                    ];
-                    throw new \Exception('通道未开通!');
-                }
-
-//                $arr = [
-//                    'type'       => 2,
-//                    'url'        => Arr::get($param, 'url', ''),
-//                    'payOrderId' => ''
-//                ];
-//                PayorderBusiness::payorderSave(collect($payorder)->toArray());
+//                if ($payorder->pay_type == 1) {
+//                    $data = PayorderBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
+//                    Log::channel('payment')->info('拉丁支付', $data);
+//                    if (Arr::get($data, 'data.code') != 200) {
+//                        throw new \Exception('通道未开通!');
+//                    }
+//                    $arr = [
+//                        'type'       => 2,
+//                        'url'        => Arr::get($data, 'data.attrData.payUrl'),
+//                        'payOrderId' => ''
+//                    ];
+//                } elseif ($payorder->pay_type == 2) {
+//                    $data = PayTwoBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
+//                    Log::channel('payment')->info('桥头支付支付', $data);
+//                    if (Arr::get($data, 'data.retCode') != 'SUCCESS') {
+//                        throw new \Exception('调用支付失败!');
+//                    }
+//                    $arr = [
+//                        'type'       => 2,
+//                        'url'        => Arr::get($data, 'data.payParams.payUrl'),
+//                        'payOrderId' => ''
+//                    ];
+//                }elseif ($payorder->pay_type == 3) {
+//                    $data = PayThreeBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
+//                    Log::channel('payment')->info('林北支付支付', $data);
+//                    if (Arr::get($data, 'data.code') != 1000) {
+//                        throw new \Exception('通道未开通!');
+//                    }
+//                    $arr = [
+//                        'type'       => 2,
+//                        'url'        => Arr::get($data, 'data.data.message.url'),
+//                        'payOrderId' => ''
+//                    ];
+//                }elseif ($payorder->pay_type == 4){
+//                    $data = PayorderBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
+//                    Log::channel('payment')->info('西门支付', $data);
+//                    if (Arr::get($data, 'data.code') != 200) {
+//                        throw new \Exception('通道未开通!');
+//                    }
+//                    $arr = [
+//                        'type'       => 2,
+//                        'url'        => Arr::get($data, 'data.attrData.payUrl'),
+//                        'payOrderId' => ''
+//                    ];
+//                }elseif ($payorder->pay_type == 5) {
+//                    $data = PayFiveBusiness::payment($payorder->order_no, $payorder->pay_characteristic, $payorder->money, Arr::get($param, 'url', ''));
+//                    Log::channel('payment')->info('鸿运支付支付', $data);
+//                    if (Arr::get($data, 'data.retCode') != 'SUCCESS') {
+//                        throw new \Exception('调用支付失败!');
+//                    }
+//                    $arr = [
+//                        'type'       => 2,
+//                        'url'        => Arr::get($data, 'data.payParams.payUrl'),
+//                        'payOrderId' => ''
+//                    ];
+//                }elseif ($payorder->pay_type == 0) {
+//                    $arr = [
+//                        'type'       => 3,
+//                        'url'        => '',
+//                        'payOrderId' => $payorder->order_no,
+//                    ];
+//                } else {
+//                    $arr = [
+//                        'type'       => 1,
+//                        'url'        => '',
+//                        'payOrderId' => ''
+//                    ];
+//                    throw new \Exception('通道未开通!');
+//                }
+
+                $arr = [
+                    'type'       => 2,
+                    'url'        => Arr::get($param, 'url', ''),
+                    'payOrderId' => ''
+                ];
+                PayorderBusiness::payorderSave(collect($payorder)->toArray());
 
             } catch (\Throwable $exception) {
                 throw new \Exception($exception->getMessage());

+ 7 - 0
app/controller/UserController.php

@@ -139,6 +139,12 @@ class UserController
             ->where('goods_type', 14)
             ->first();
 
+        $is_buy_xinpianshengji = Db::table('wa_payorder')
+            ->where('user_id', $request->user_data['id'])
+            ->where('is_pay', 2)
+            ->where('goods_type', 15)
+            ->first();
+
         $arr = [
             'img'              => !empty($request->user_data['img']) ? imageToBase64($request->user_data['img']) : '',
             'uuid'             => $request->user_data['uuid'],
@@ -171,6 +177,7 @@ class UserController
             'is_buy_vip'       => $is_buy_vip ? true : false,
             'is_buy_dtpass'    => $is_buy_dtpass ? true : false,
             'is_buy_tenfour'    => $is_buy_tenfour ? true : false,
+            'is_buy_xinpianshengji'    => $is_buy_xinpianshengji ? true : false,
             'day_is_sign'      => true,
             'is_wechat'        => true,
             'is_alipay'        => true,