|
|
@@ -357,17 +357,35 @@ 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;
|
|
364
|
364
|
}else if ($type == 2) {
|
|
365
|
365
|
$brokerage_price = bcsub($user['member_brokerage_price'],$data['extract_price'],2);
|
|
366
|
366
|
$user->member_brokerage_price = $brokerage_price;
|
|
|
367
|
+ }else if ($type == 3) {
|
|
|
368
|
+ $hongbao = bcsub($user['hongbao'],$data['extract_price'],2);
|
|
|
369
|
+ $user->hongbao = $hongbao;
|
|
367
|
370
|
}
|
|
368
|
371
|
|
|
369
|
372
|
$user->save();
|
|
370
|
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
|
+
|
|
371
|
389
|
$service_money=bcmul($data['extract_price'],'0.1',2);
|
|
372
|
390
|
$data['service_money']=$service_money;
|
|
373
|
391
|
$data['status'] = 0;
|
|
|
@@ -384,6 +402,9 @@ class UserExtractRepository extends BaseRepository
|
|
384
|
402
|
}else if ($type == 2) {
|
|
385
|
403
|
$brokerage_price = bcsub($user['member_brokerage_price'],$data['extract_price'],2);
|
|
386
|
404
|
$user->member_brokerage_price = $brokerage_price;
|
|
|
405
|
+ }else if ($type == 3) {
|
|
|
406
|
+ $hongbao = bcsub($user['hongbao'],$data['extract_price'],2);
|
|
|
407
|
+ $user->hongbao = $hongbao;
|
|
387
|
408
|
}
|
|
388
|
409
|
$user->save();
|
|
389
|
410
|
$service_money=bcmul($data['extract_price'],'0.1',2);
|
|
|
@@ -404,8 +425,24 @@ class UserExtractRepository extends BaseRepository
|
|
404
|
425
|
$extract_price_yihu= $tea_price;
|
|
405
|
426
|
$service_money_yihu= bcmul($tea_price,'0.1',2);
|
|
406
|
427
|
}
|
|
|
428
|
+ }
|
|
407
|
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);
|
|
408
|
443
|
}
|
|
|
444
|
+
|
|
|
445
|
+
|
|
409
|
446
|
// if($extract_price_yihu>0){
|
|
410
|
447
|
$insertAll[]=array(
|
|
411
|
448
|
'extract_id'=>$extract->extract_id,
|