From b1bc78c71ea13f6da92a3d4b75450484658713fd Mon Sep 17 00:00:00 2001 From: ljl Date: Fri, 16 Jun 2023 10:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/RebateService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Service/RebateService.php b/app/Service/RebateService.php index dd1d0c7..598a502 100644 --- a/app/Service/RebateService.php +++ b/app/Service/RebateService.php @@ -524,8 +524,9 @@ class RebateService extends Service public function getDayAccumulativeRoleGiftGropMap($baseGame, $gifts, $roles) { if ($baseGame->id == 17) { $roleGiftGroupMap = []; - $serverIds = $roles->pluck('server_id')->toArray(); - $servers = Server::whereIn('server_id', $serverIds)->get(['server_id', 'create_time'])->keyBy('server_id'); + $serverIds = array_unique($roles->pluck('server_id')->toArray()); + $gameIds = [$baseGame->android_game_id, $baseGame->ios_game_id]; + $servers = Server::whereIn('game_id', $gameIds)->whereIn('server_id', $serverIds)->get(['server_id', 'create_time'])->keyBy('server_id'); foreach ($roles as $role) { $serverCreateTime = $servers[$role->server_id] ? $servers[$role->server_id]->create_time : time(); $serverCreateTime = strtotime(date('Y-m-d 00:00:00', $serverCreateTime)); @@ -546,6 +547,7 @@ class RebateService extends Service $roleGiftGroupMap[$role->role_id] = 7; } } + var_dump($roleGiftGroupMap); return $roleGiftGroupMap; } else { return [];