From b236a8b2001dd9624aceefe1728929d05d76b7f5 Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Sun, 16 Feb 2025 21:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=B6=E7=BA=A7=E5=88=86=E7=BA=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/dao/UserRewardDao.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/dao/UserRewardDao.php b/app/dao/UserRewardDao.php index 2a75cb9..c8e1360 100644 --- a/app/dao/UserRewardDao.php +++ b/app/dao/UserRewardDao.php @@ -21,21 +21,21 @@ class UserRewardDao /** * 挂机获得的奖励 */ - public static function Onhookincome($userid,$money) + public static function Onhookincome($userid, $money) { self::base($userid, 6, $money, '挂机收益'); } /** * 加粉赏金奖励 */ - public static function bounty($userid,$money) + public static function bounty($userid, $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(); $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); - if($user->f_id!=0&&$user->f_id!=0){ - $f=User::find($user->f_id); + if ($user->f_id != 0) { + $f = User::find($user->f_id); self::base($f->id, 5, $f_dividend, '加粉赏金'); - $ff=User::find($user->ff_id); - self::base($ff->id, 5, $ff_dividend, '加粉赏金'); + if ($user->ff_id != 0) { + $ff = User::find($user->ff_id); + self::base($ff->id, 5, $ff_dividend, '加粉赏金'); + } } - } /** * 搜索函数