Skip to content

Commit

Permalink
revert takeRandom logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Aug 24, 2021
1 parent f7ce670 commit a98011a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ public function boot(): void
/** @var \Illuminate\Database\Eloquent\Builder $this */

return $this
->orderByRaw('randomness <-> point(?, ?)', [
(random_int(PHP_INT_MIN, PHP_INT_MAX) / PHP_INT_MAX),
(random_int(PHP_INT_MIN, PHP_INT_MAX) / PHP_INT_MAX),
])
->limit($limit)
->get();
->limit($limit * 3)
->whereRaw('RANDOM() < 0.1')
->get()
->shuffle()
->take($limit)
->values();
});
}
}

0 comments on commit a98011a

Please sign in to comment.