Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Noah Lancien
5c9ef056f9 chore: bump version to 2.4.10 2025-07-16 16:06:56 +02:00
Noah Lancien
91a8b7f539 fix: check the participations for ip + customers instead of only ip 2025-07-16 16:04:47 +02:00
2 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,7 @@ class ParticipationPolicy
if ($settings->nb_participation_player) {
$playerCanParticipateAccount = (Participation::query()->whereHas(
'customer',
fn (Builder $q) => $q->where('customer_id', $authUser->id)
fn(Builder $q) => $q->where('customer_id', $authUser->id)
)->count() < $settings->nb_participation_player);
}
// * Participation par IP
@ -49,7 +49,7 @@ class ParticipationPolicy
if ($settings->nb_participation_ip) {
$playerCanParticipateIp = (Participation::query()->whereHas(
'customer',
fn (Builder $q) => $q->where('ip', app('clientIp'))
fn(Builder $q) => $q->where('ip', app('clientIp'))->where('customer_id', $authUser->id)
)->count() < $settings->nb_participation_ip);
}
$playerCanParticipate = (!empty($playerCanParticipateAccount) && !empty($playerCanParticipateIp)) ?
@ -94,7 +94,7 @@ class ParticipationPolicy
->where('prize_sent', false)
->whereHas(
'customer',
fn (Builder $q) =>
fn(Builder $q) =>
$q->where('id', $authUser->id)
)->where('id', $model->id)->whereHas('instantWin')
->where(function (Builder $q) {

View file

@ -1,6 +1,6 @@
{
"name": "uwil/gen-game-web",
"version": "2.4.9",
"version": "2.4.10",
"type": "project",
"description": "Game generator",
"support": {