[CLEAR-38] order by created
This commit is contained in:
parent
36e6cd575c
commit
95a9f9c664
@ -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)->orderByDesc('created_at')->get();
|
$userRecipes = UsersRecipes::where('user_id', $userID)->orderBy('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