父级分红

This commit is contained in:
lingling 2025-02-16 21:20:18 +08:00
parent 1c0b6c5bf6
commit b236a8b200
1 changed files with 13 additions and 11 deletions

View File

@ -21,21 +21,21 @@ class UserRewardDao
/** /**
* 挂机获得的奖励 * 挂机获得的奖励
*/ */
public static function Onhookincome($userid,$money) public static function Onhookincome($userid, $money)
{ {
self::base($userid, 6, $money, '挂机收益'); self::base($userid, 6, $money, '挂机收益');
} }
/** /**
* 加粉赏金奖励 * 加粉赏金奖励
*/ */
public static function bounty($userid,$money) public static function bounty($userid, $money)
{ {
self::base($userid, 5, $money, '加粉赏金'); self::base($userid, 5, $money, '加粉赏金');
} }
/** /**
* 公共函数 * 公共函数
*/ */
public static function base($userid, $status, $money, $memo,$is_f_bounty=1) public static function base($userid, $status, $money, $memo, $is_f_bounty = 1)
{ {
$UserReward = new UserReward(); $UserReward = new UserReward();
$user = User::find($userid); $user = User::find($userid);
@ -55,19 +55,21 @@ class UserRewardDao
/** /**
* 父级 父父级分红 * 父级 父父级分红
*/ */
public static function f_bounty($userid, $status, $money, $memo){ public static function f_bounty($userid, $status, $money, $memo)
{
//父分红 //父分红
$f_dividend=floor($money*0.2); $f_dividend = floor($money * 0.2);
//父父分红 //父父分红
$ff_dividend=floor($money*0.1); $ff_dividend = floor($money * 0.1);
$user = User::find($userid); $user = User::find($userid);
if($user->f_id!=0&&$user->f_id!=0){ if ($user->f_id != 0) {
$f=User::find($user->f_id); $f = User::find($user->f_id);
self::base($f->id, 5, $f_dividend, '加粉赏金'); self::base($f->id, 5, $f_dividend, '加粉赏金');
$ff=User::find($user->ff_id); if ($user->ff_id != 0) {
self::base($ff->id, 5, $ff_dividend, '加粉赏金'); $ff = User::find($user->ff_id);
self::base($ff->id, 5, $ff_dividend, '加粉赏金');
}
} }
} }
/** /**
* 搜索函数 * 搜索函数