chg: [auditlogs:index] Reverse sort by ID
parent
f37cea1cad
commit
8d26be28a2
|
@ -20,6 +20,7 @@ class AuditLogsController extends AppController
|
||||||
{
|
{
|
||||||
$this->CRUD->index([
|
$this->CRUD->index([
|
||||||
'contain' => $this->containFields,
|
'contain' => $this->containFields,
|
||||||
|
'order' => ['AuditLogs.id' => 'DESC'],
|
||||||
'filters' => $this->filterFields,
|
'filters' => $this->filterFields,
|
||||||
'quickFilters' => $this->quickFilterFields,
|
'quickFilters' => $this->quickFilterFields,
|
||||||
'afterFind' => function($data) {
|
'afterFind' => function($data) {
|
||||||
|
|
|
@ -69,6 +69,9 @@ class CRUDComponent extends Component
|
||||||
if (!empty($options['fields'])) {
|
if (!empty($options['fields'])) {
|
||||||
$query->select($options['fields']);
|
$query->select($options['fields']);
|
||||||
}
|
}
|
||||||
|
if (!empty($options['order'])) {
|
||||||
|
$query->order($options['order']);
|
||||||
|
}
|
||||||
if ($this->Controller->ParamHandler->isRest()) {
|
if ($this->Controller->ParamHandler->isRest()) {
|
||||||
$data = $query->all();
|
$data = $query->all();
|
||||||
if (isset($options['hidden'])) {
|
if (isset($options['hidden'])) {
|
||||||
|
|
Loading…
Reference in New Issue