fix(shopro): 修复体育游戏自动退坑和更新用户得分逻辑

- 在 Game 控制器中,为 teamAuser 查询添加 status > -1 的条件,以确保只更新有效用户的得分
- 在 OrderAutoOper 任务中,修复 GameJoin 表格的 status 字段更新逻辑,并添加 Participant 表格的状态更新
This commit is contained in:
2025-05-31 22:22:47 +08:00
parent 35725ffd2d
commit 1b63962bff
2 changed files with 6 additions and 2 deletions

View File

@@ -388,7 +388,9 @@ class Game extends Base
// 更新用户得分
$teamA = json_decode($match->teamA, true);
$teamAuser = Participant::where('game_id', $game['id'])->where('user_id', 'IN', array_column($teamA['user'], 'user_id'))->select();
$teamAuser = Participant::where('game_id', $game['id'])
->where('user_id', 'IN', array_column($teamA['user'], 'user_id'))
->where('status', '>', -1)->select();
// dd($teamAuser);
foreach ($teamAuser as $u) {
$u->team = $teamA['name']; //队伍名