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 [];