[CLEAR-38] order by created
This commit is contained in:
parent
d176703b00
commit
36e6cd575c
@ -49,7 +49,7 @@ class UsersRepository implements UsersRepositoryInterface
|
|||||||
|
|
||||||
public function getRecipeHistory(int $userID, string $groupBy = 'day')
|
public function getRecipeHistory(int $userID, string $groupBy = 'day')
|
||||||
{
|
{
|
||||||
$userRecipes = UsersRecipes::where('user_id', $userID)->get();
|
$userRecipes = UsersRecipes::where('user_id', $userID)->orderByDesc('created_at')->get();
|
||||||
$recipeHistory = [];
|
$recipeHistory = [];
|
||||||
if ($groupBy == 'month') {
|
if ($groupBy == 'month') {
|
||||||
$userRecipes = $userRecipes->groupBy(function ($d) {
|
$userRecipes = $userRecipes->groupBy(function ($d) {
|
||||||
|
Loading…
Reference in New Issue
Block a user