Procházet zdrojové kódy

红包提现&红包转VR

xialei před 1 rokem
rodič
revize
87ed02d730

+ 33 - 1
app/common/repositories/user/UserExtractRepository.php

@@ -357,7 +357,7 @@ class UserExtractRepository extends BaseRepository
357 357
             return false;
358 358
         }
359 359
         if ($data["extract_type"]==3){
360
-            $data = Db::transaction(function()use($user,$data, $type){
360
+            $data = Db::transaction(function()use($user,$data, $type,$uid){
361 361
                 if($type==1){
362 362
                     $brokerage_price = bcsub($user['brokerage_price'],$data['extract_price'],2);
363 363
                     $user->brokerage_price = $brokerage_price;
@@ -371,6 +371,21 @@ class UserExtractRepository extends BaseRepository
371 371
 
372 372
                 $user->save();
373 373
 
374
+                if($type == 3){
375
+                    //加入红包提现记录
376
+                   $insertdata = [
377
+                       'uid'=> $uid,
378
+                       'number' =>  $data['extract_price'],
379
+                       'surplus' => $user->hongbao,
380
+                       'mark' => '红包提现',
381
+                       'type' => 2,
382
+                       'status' => -1,
383
+                       'addtime' => time(),
384
+                   ];
385
+                   Db::name('user_sign_hongbao')->insertGetId($insertdata);
386
+               }
387
+
388
+
374 389
                 $service_money=bcmul($data['extract_price'],'0.1',2);
375 390
                 $data['service_money']=$service_money;
376 391
                 $data['status'] = 0;
@@ -411,6 +426,23 @@ class UserExtractRepository extends BaseRepository
411 426
                         $service_money_yihu= bcmul($tea_price,'0.1',2);
412 427
                     }
413 428
                 }
429
+
430
+
431
+                if($type == 3){
432
+                     //加入红包提现记录
433
+                    $insertdata = [
434
+                        'uid'=> $uid,
435
+                        'number' =>  $data['extract_price'],
436
+                        'surplus' => $user->hongbao,
437
+                        'mark' => '红包提现',
438
+                        'type' => 2,
439
+                        'status' => -1,
440
+                        'addtime' => time(),
441
+                    ];
442
+                    Db::name('user_sign_hongbao')->insertGetId($insertdata);
443
+                }
444
+
445
+
414 446
 //                    if($extract_price_yihu>0){
415 447
                 $insertAll[]=array(
416 448
                     'extract_id'=>$extract->extract_id,

+ 3 - 2
app/controller/api/user/User.php

@@ -3344,9 +3344,10 @@ return app("json")->success($data);
3344 3344
                     'surplus' => $vr,
3345 3345
                     'mark' => '红包转VR',
3346 3346
                     'type' => 2,
3347
-                    'create_time' => time(),
3347
+                    'status' => -1,
3348
+                    'addtime' => time(),
3348 3349
                 ];
3349
-                Db::name('user_transition_vr')->insertGetId($insertdata);
3350
+                Db::name('user_sign_hongbao')->insertGetId($insertdata);
3350 3351
                 //VR入账
3351 3352
                 $insertdata = [
3352 3353
                     'uid'=> $uid,

+ 1 - 1
app/controller/api/user/UserExtract.php

@@ -46,7 +46,7 @@ class UserExtract extends BaseController
46 46
     public function lst()
47 47
     {
48 48
         [$page,$limit] = $this->getPage();
49
-        $where = $this->request->params(['status']);
49
+        $where = $this->request->params(['status', 'type']);
50 50
         $where['uid'] = $this->request->uid();
51 51
         return app('json')->success($this->repository->serach($where,$page,$limit));
52 52
     }