|
|
@ -524,8 +524,9 @@ class RebateService extends Service
|
|
|
|
public function getDayAccumulativeRoleGiftGropMap($baseGame, $gifts, $roles) {
|
|
|
|
public function getDayAccumulativeRoleGiftGropMap($baseGame, $gifts, $roles) {
|
|
|
|
if ($baseGame->id == 17) {
|
|
|
|
if ($baseGame->id == 17) {
|
|
|
|
$roleGiftGroupMap = [];
|
|
|
|
$roleGiftGroupMap = [];
|
|
|
|
$serverIds = $roles->pluck('server_id')->toArray();
|
|
|
|
$serverIds = array_unique($roles->pluck('server_id')->toArray());
|
|
|
|
$servers = Server::whereIn('server_id', $serverIds)->get(['server_id', 'create_time'])->keyBy('server_id');
|
|
|
|
$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) {
|
|
|
|
foreach ($roles as $role) {
|
|
|
|
$serverCreateTime = $servers[$role->server_id] ? $servers[$role->server_id]->create_time : time();
|
|
|
|
$serverCreateTime = $servers[$role->server_id] ? $servers[$role->server_id]->create_time : time();
|
|
|
|
$serverCreateTime = strtotime(date('Y-m-d 00:00:00', $serverCreateTime));
|
|
|
|
$serverCreateTime = strtotime(date('Y-m-d 00:00:00', $serverCreateTime));
|
|
|
@ -546,6 +547,7 @@ class RebateService extends Service
|
|
|
|
$roleGiftGroupMap[$role->role_id] = 7;
|
|
|
|
$roleGiftGroupMap[$role->role_id] = 7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var_dump($roleGiftGroupMap);
|
|
|
|
return $roleGiftGroupMap;
|
|
|
|
return $roleGiftGroupMap;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return [];
|
|
|
|
return [];
|
|
|
|