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 {