one_after 2 tháng trước cách đây
mục cha
commit
491f32665b
2 tập tin đã thay đổi với 21 bổ sung11 xóa
  1. 0 11
      app/business/PayorderBusiness.php
  2. 21 0
      app/controller/UserController.php

+ 0 - 11
app/business/PayorderBusiness.php

@@ -610,18 +610,7 @@ class PayorderBusiness
             } elseif ($goodsData->type == 7) {
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
             } elseif ($goodsData->type == 8) {
-                $datawithdraw = Db::table('wa_withdraw')
-                    ->whereIn('type', [17, 10])
-                    ->where('user_id', $data['user_id'])
-                    ->where('status', 1)
-                    ->orderByDesc('id')
-                    ->get()->toArray();
-                foreach ($datawithdraw as $k => $v) {
-                    Db::table('wa_withdraw')->where('id', $v->id)->update(['status' => 3, 'updated_at' => date('Y-m-d H:i:s')]);
-                    Db::table('wa_withdraw')->where('id', $v->id)->update(['status' => 3, 'updated_at' => date('Y-m-d H:i:s')]);
-                    StreamBusiness::addStream($v->user_id, $v->money, streamType4, moldType3, moldTypefild3, $v->id);
 
-                }
                 $protocol_money = Db::table('wa_withdraw')
                     ->whereIn('type', [17, 10])
                     ->where('user_id', $data['user_id'])

+ 21 - 0
app/controller/UserController.php

@@ -107,6 +107,12 @@ class UserController
             ->where('goods_type', 7)
             ->exists();
 
+        $is_buy_qianshuxieyi = Db::table('wa_payorder')
+            ->where('user_id', $request->user_data['id'])
+            ->where('is_pay', 2)
+            ->where('goods_type', 8)
+            ->exists();
+
         $arr       = [
             'img'                 => !empty($request->user_data['img']) ? imageToBase64($request->user_data['img']) : '',
             'uuid'                => $request->user_data['uuid'],
@@ -225,6 +231,21 @@ class UserController
             StreamBusiness::addStream($request->user_data['id'], 3000, streamType46, moldType16, moldTypefild16);
         }
 
+        if($is_buy_qianshuxieyi){
+            $datawithdraw = Db::table('wa_withdraw')
+                ->whereIn('type', [17, 10])
+                ->where('user_id', $request->user_data['id'])
+                ->where('status', 1)
+                ->orderByDesc('id')
+                ->get()->toArray();
+            foreach ($datawithdraw as $k => $v) {
+                Db::table('wa_withdraw')->where('id', $v->id)->update(['status' => 3, 'updated_at' => date('Y-m-d H:i:s')]);
+                Db::table('wa_withdraw')->where('id', $v->id)->update(['status' => 3, 'updated_at' => date('Y-m-d H:i:s')]);
+                StreamBusiness::addStream($v->user_id, $v->money, streamType4, moldType3, moldTypefild3, $v->id);
+            }
+        }
+
+
 
         return success($arr);
     }