From 20a3c5dd50a892086ae0ff42759d4f0e1e37695c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=8B=BC?= <2468023037@qq.com> Date: Tue, 18 Feb 2025 10:33:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A8=E5=B9=BF=E6=94=B6=E7=9B=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/Task3.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/process/Task3.php b/process/Task3.php index 08ad775..a58b096 100644 --- a/process/Task3.php +++ b/process/Task3.php @@ -51,20 +51,25 @@ class Task3 echo date('Y-m-d H:i:s')."\n"; //获取今天在线时间超过6小时的用户 $today = date('Y-m-d'); - $UserPhone = UserPhone::where('time', '>', 3600)::where('created_at','>=',$today)->get(); + $UserPhone = UserPhone::where('time', '>=', 3600)::where('time', '<', 4200)::where('created_at','>=',$today)->get(); //判断用户绑定Whatsapp首次登录 foreach ($UserPhone as $key => $value) { $user_id = $value->user_id; $user = User::find($user_id); + if (!$user) { + continue; + } //获取该用户的父级 $parent = User::find($user->f_id); + var_dump($parent); //满足则加80积分 - UserRewardDao::base($parent->username, 6, 80, '任务佣金'); + UserRewardDao::base($parent->id, 5, 80, '推广收益'); //vip_id等级加1,并更新数据库 - $user->vip_id += 1; + $parent->vip_id += 1; //今天邀请人数加1 - $user->today_num += 1; - $user->save(); + $parent->today_num += 1; + $parent->today_team_income+=80; + $parent->save(); } });