diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php index fe3fa4e1..1cdb8b96 100644 --- a/includes/pages/admin_questions.php +++ b/includes/pages/admin_questions.php @@ -42,7 +42,7 @@ function admin_questions() if (!$request->has('action')) { $unanswered_questions_table = []; - $unanswered_questions = Question::unanswered()->get(); + $unanswered_questions = Question::unanswered()->orderByDesc('created_at')->get(); foreach ($unanswered_questions as $question) { /* @var Question $question */ @@ -63,7 +63,7 @@ function admin_questions() } $answered_questions_table = []; - $answered_questions = Question::answered()->get(); + $answered_questions = Question::answered()->orderByDesc('answered_at')->get(); foreach ($answered_questions as $question) { /* @var Question $question */ diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php index 7654d540..6c3dac92 100644 --- a/includes/pages/user_questions.php +++ b/includes/pages/user_questions.php @@ -19,8 +19,14 @@ function user_questions() $request = request(); if (!$request->has('action')) { - $open_questions = $user->questionsAsked()->whereNull('answerer_id')->get(); - $answered_questions = $user->questionsAsked()->whereNotNull('answerer_id')->get(); + $open_questions = $user->questionsAsked() + ->whereNull('answerer_id') + ->orderByDesc('created_at') + ->get(); + $answered_questions = $user->questionsAsked() + ->whereNotNull('answerer_id') + ->orderByDesc('answered_at') + ->get(); return Questions_view( $open_questions->all(),