From 15fa3a1f71ebf6d52d6301c2ec9696d46736d02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=8B=BC?= <2468023037@qq.com> Date: Mon, 17 Feb 2025 22:37:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Vip_rewardController.php | 1 + app/controller/api/Vip_salaryController.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/controller/api/Vip_rewardController.php b/app/controller/api/Vip_rewardController.php index 8611bf1..909926b 100644 --- a/app/controller/api/Vip_rewardController.php +++ b/app/controller/api/Vip_rewardController.php @@ -208,6 +208,7 @@ class Vip_rewardController //获取该用户今天的领奖记录 $UserRewasrds = UserReward::where('user_id', $user_id) ->whereDate('created_at', date('Y-m-d')) + ->where('memo', 'like', '%' . '等级奖励' . '%') ->get(); // 遍历每个用户记录并更新 status 字段 foreach ($datas as &$data) { diff --git a/app/controller/api/Vip_salaryController.php b/app/controller/api/Vip_salaryController.php index 3a0f77d..71ef20a 100644 --- a/app/controller/api/Vip_salaryController.php +++ b/app/controller/api/Vip_salaryController.php @@ -12,6 +12,7 @@ use App\model\Project; use App\model\ProjectDetailed; use App\model\ProjectRegister; use App\model\Carouselad; +use App\model\UserReward; use App\model\VipLevel; use App\dao\UserRewardDao; use App\Utils\ApiResponseApp; @@ -85,8 +86,22 @@ class Vip_salaryController "user_count" => 2000 ] ]; + //获取该用户今天的领奖记录 + $UserRewasrds = UserReward::where('user_id', $user_id) + ->whereDate('created_at', date('Y-m-d')) + ->where('memo', 'like', '%' . '晋升奖励' . '%') + ->get(); // 遍历每个用户记录并更新 status 字段 foreach ($datas as &$data) { + foreach ($UserRewasrds as $UserRewasrd) { + if (strpos($UserRewasrd->memo, $data['vip_id'].'晋升奖励') !== false) { + $data['status'] = 2; + break; + } + } + if ($data['status'] == 2) { + continue; + } if ($user->vip_id >= $data['user_count']) { $data['status'] = 1; // 满足条件时设置状态为1 } else {