feat: sort documents by status 'new' on initial render
This commit is contained in:
@@ -30,11 +30,7 @@ class IndexController extends AbstractController
|
||||
$pagination = $this->paginator->paginate(
|
||||
$query,
|
||||
$request->query->getInt('page', 1),
|
||||
10,
|
||||
[
|
||||
'defaultSortFieldName' => 'upload.createdAt',
|
||||
'defaultSortDirection' => 'asc',
|
||||
]
|
||||
10
|
||||
);
|
||||
|
||||
return $this->render('administrative/document/index.html.twig', [
|
||||
|
||||
@@ -89,6 +89,9 @@ class UploadRepository extends ServiceEntityRepository
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->addOrderBy('FIELD(upload.status, :new, :checked)', 'ASC')
|
||||
->setParameter('new', Upload::STATUS_NEW)
|
||||
->setParameter('checked', Upload::STATUS_CHECKED)
|
||||
->getQuery()
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user