|
|
|
@ -481,13 +481,12 @@ class RebateService extends Service
|
|
|
|
|
$roleGiftGroupMap = $this->getDayAccumulativeRoleGiftGropMap($baseGame, $gifts, $roles);
|
|
|
|
|
$records = [];
|
|
|
|
|
foreach ($items as $roleId => $amount) {
|
|
|
|
|
$gifts = $gifts->where('group', $roleGiftGroupMap[$roleId] ?? 0);
|
|
|
|
|
$groupGifts = $gifts->where('group', $roleGiftGroupMap[$roleId] ?? 0);
|
|
|
|
|
if ($roleId == '66036') {
|
|
|
|
|
var_dump($roleGiftGroupMap[$roleId]);
|
|
|
|
|
var_dump($gifts->toArray());
|
|
|
|
|
var_dump($groupGifts->toArray());
|
|
|
|
|
}
|
|
|
|
|
$maxGift = null;
|
|
|
|
|
foreach ($gifts as $gift) {
|
|
|
|
|
foreach ($groupGifts as $gift) {
|
|
|
|
|
if ($amount >= $gift->amount) {
|
|
|
|
|
if ($mode == 'max') {
|
|
|
|
|
$maxGift = $gift;
|
|
|
|
|