diff --git a/server/controllers/staff/get-all-tickets.php b/server/controllers/staff/get-all-tickets.php index 6957c118..7c38a489 100755 --- a/server/controllers/staff/get-all-tickets.php +++ b/server/controllers/staff/get-all-tickets.php @@ -63,7 +63,7 @@ class GetAllTicketsStaffController extends Controller { $query = $this->getSearchQuery(); $query .= $this->getStaffDepartmentsQueryFilter(); $query .= $this->getClosedFilter(); - $query .= "ORDER BY CASE WHEN (title LIKE ?) THEN 1 ELSE 2 END ASC LIMIT 10 OFFSET " . (($page-1)*10); + $query .= "ORDER BY CASE WHEN (title LIKE ?) THEN 1 ELSE 2 END ASC, id DESC LIMIT 10 OFFSET " . (($page-1)*10); return Ticket::find($query, [ Controller::request('query') . '%',