one_after 2 月之前
父节点
当前提交
7033688f55
共有 1 个文件被更改,包括 54 次插入47 次删除
  1. 54 47
      app/business/PayorderBusiness.php

+ 54 - 47
app/business/PayorderBusiness.php

@@ -687,53 +687,60 @@ class PayorderBusiness
                     $account_holder  = $bankCard->account_holder;
                     $card_number     = $bankCard->card_number;
                 }
-                $withdrawId = Db::table('wa_withdraw')->insertGetId([
-                    'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
-                    'user_id'         => $data['user_id'],
-                    'money'           => $userlist->money_ten,
-                    'type'            => 10,
-                    'affiliated_bank' => $affiliated_bank,
-                    'account_holder'  => $account_holder,
-                    'card_number'     => $card_number,
-                    'img'             => '',
-                    'created_at'      => date('Y-m-d H:i:s'),
-                    'updated_at'      => date('Y-m-d H:i:s'),
-                    'status'          => 3,
-                    'new_state'       => 2
-                ]);
-                StreamBusiness::delStream($data['user_id'], $userlist->money_ten, streamType4,moldType10, moldTypefild10, $withdrawId);
-
-                $withdrawIdtwo = Db::table('wa_withdraw')->insertGetId([
-                    'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
-                    'user_id'         => $data['user_id'],
-                    'money'           => $userlist->money_sixteen,
-                    'type'            => 16,
-                    'affiliated_bank' => $affiliated_bank,
-                    'account_holder'  => $account_holder,
-                    'card_number'     => $card_number,
-                    'img'             => '',
-                    'created_at'      => date('Y-m-d H:i:s'),
-                    'updated_at'      => date('Y-m-d H:i:s'),
-                    'status'          => 3,
-                    'new_state'       => 2
-                ]);
-                StreamBusiness::delStream($data['user_id'], $userlist->money_sixteen, streamType4,moldType16, moldTypefild16, $withdrawIdtwo);
-
-                $withdrawIdthree = Db::table('wa_withdraw')->insertGetId([
-                    'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
-                    'user_id'         => $data['user_id'],
-                    'money'           => $userlist->money_seventeen,
-                    'type'            => 17,
-                    'affiliated_bank' => $affiliated_bank,
-                    'account_holder'  => $account_holder,
-                    'card_number'     => $card_number,
-                    'img'             => '',
-                    'created_at'      => date('Y-m-d H:i:s'),
-                    'updated_at'      => date('Y-m-d H:i:s'),
-                    'status'          => 3,
-                    'new_state'       => 2
-                ]);
-                StreamBusiness::delStream($data['user_id'], $userlist->money_seventeen, streamType4,moldType17, moldTypefild17, $withdrawIdthree);
+                if(!empty($userlist->money_ten)){
+                    $withdrawId = Db::table('wa_withdraw')->insertGetId([
+                        'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
+                        'user_id'         => $data['user_id'],
+                        'money'           => $userlist->money_ten,
+                        'type'            => 10,
+                        'affiliated_bank' => $affiliated_bank,
+                        'account_holder'  => $account_holder,
+                        'card_number'     => $card_number,
+                        'img'             => '',
+                        'created_at'      => date('Y-m-d H:i:s'),
+                        'updated_at'      => date('Y-m-d H:i:s'),
+                        'status'          => 3,
+                        'new_state'       => 2
+                    ]);
+                    StreamBusiness::delStream($data['user_id'], $userlist->money_ten, streamType4,moldType10, moldTypefild10, $withdrawId);
+
+                }
+                if(!empty($userlist->money_sixteen)){
+                    $withdrawIdtwo = Db::table('wa_withdraw')->insertGetId([
+                        'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
+                        'user_id'         => $data['user_id'],
+                        'money'           => $userlist->money_sixteen,
+                        'type'            => 16,
+                        'affiliated_bank' => $affiliated_bank,
+                        'account_holder'  => $account_holder,
+                        'card_number'     => $card_number,
+                        'img'             => '',
+                        'created_at'      => date('Y-m-d H:i:s'),
+                        'updated_at'      => date('Y-m-d H:i:s'),
+                        'status'          => 3,
+                        'new_state'       => 2
+                    ]);
+                    StreamBusiness::delStream($data['user_id'], $userlist->money_sixteen, streamType4,moldType16, moldTypefild16, $withdrawIdtwo);
+
+                }
+                if(!empty($userlist->money_seventeen)){
+                    $withdrawIdthree = Db::table('wa_withdraw')->insertGetId([
+                        'order_no'        => date('YmdHis') . mt_rand(10000, 99999),
+                        'user_id'         => $data['user_id'],
+                        'money'           => $userlist->money_seventeen,
+                        'type'            => 17,
+                        'affiliated_bank' => $affiliated_bank,
+                        'account_holder'  => $account_holder,
+                        'card_number'     => $card_number,
+                        'img'             => '',
+                        'created_at'      => date('Y-m-d H:i:s'),
+                        'updated_at'      => date('Y-m-d H:i:s'),
+                        'status'          => 3,
+                        'new_state'       => 2
+                    ]);
+                    StreamBusiness::delStream($data['user_id'], $userlist->money_seventeen, streamType4,moldType17, moldTypefild17, $withdrawIdthree);
+
+                }
 
             }