orden de resultados por defecto DESC de id y fecha

This commit is contained in:
Carlos Jimenez Ruiz 2019-03-20 11:49:11 +01:00
parent c13dba24b9
commit d38ca72fd8
4 changed files with 123 additions and 114 deletions

View File

@ -5,7 +5,7 @@
<vn-table model="$ctrl.model"> <vn-table model="$ctrl.model">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th field="creationDate" default-order="DESC">Date</vn-th> <vn-th field="creationDate">Date</vn-th>
<vn-th field="userFk" class="expendable">Changed by</vn-th> <vn-th field="userFk" class="expendable">Changed by</vn-th>
<vn-th field="changedModel" class="expendable">Model</vn-th> <vn-th field="changedModel" class="expendable">Model</vn-th>
<vn-th field="action" class="expendable">Action</vn-th> <vn-th field="action" class="expendable">Action</vn-th>

View File

@ -1,55 +1,58 @@
{ {
"name": "ClientLog", "name": "ClientLog",
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "clientLog" "table": "clientLog"
} }
}, },
"properties": { "properties": {
"id": { "id": {
"id": true, "id": true,
"type": "Number", "type": "Number",
"forceId": false "forceId": false
}, },
"originFk": { "originFk": {
"type": "Number", "type": "Number",
"required": true "required": true
}, },
"userFk": { "userFk": {
"type": "Number" "type": "Number"
}, },
"action": { "action": {
"type": "String", "type": "String",
"required": true "required": true
}, },
"changedModel": { "changedModel": {
"type": "String" "type": "String"
}, },
"oldInstance": { "oldInstance": {
"type": "Object" "type": "Object"
}, },
"newInstance": { "newInstance": {
"type": "Object" "type": "Object"
}, },
"creationDate": { "creationDate": {
"type": "Date" "type": "Date"
}, },
"changedModelId": { "changedModelId": {
"type": "Number" "type": "Number"
}, },
"changedModelValue": { "changedModelValue": {
"type": "String" "type": "String"
}, },
"description": { "description": {
"type": "String" "type": "String"
} }
}, },
"relations": { "relations": {
"user": { "user": {
"type": "belongsTo", "type": "belongsTo",
"model": "Account", "model": "Account",
"foreignKey": "userFk" "foreignKey": "userFk"
} }
} },
"scope": {
"order": ["creationDate DESC", "id DESC"]
}
} }

View File

@ -1,55 +1,58 @@
{ {
"name": "ItemLog", "name": "ItemLog",
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "itemLog" "table": "itemLog"
} }
}, },
"properties": { "properties": {
"id": { "id": {
"id": true, "id": true,
"type": "Number", "type": "Number",
"forceId": false "forceId": false
}, },
"originFk": { "originFk": {
"type": "Number", "type": "Number",
"required": true "required": true
}, },
"userFk": { "userFk": {
"type": "Number" "type": "Number"
}, },
"action": { "action": {
"type": "String", "type": "String",
"required": true "required": true
}, },
"changedModel": { "changedModel": {
"type": "String" "type": "String"
}, },
"oldInstance": { "oldInstance": {
"type": "Object" "type": "Object"
}, },
"newInstance": { "newInstance": {
"type": "Object" "type": "Object"
}, },
"creationDate": { "creationDate": {
"type": "Date" "type": "Date"
}, },
"changedModelId": { "changedModelId": {
"type": "Number" "type": "Number"
}, },
"changedModelValue": { "changedModelValue": {
"type": "String" "type": "String"
}, },
"description": { "description": {
"type": "String" "type": "String"
} }
}, },
"relations": { "relations": {
"user": { "user": {
"type": "belongsTo", "type": "belongsTo",
"model": "Account", "model": "Account",
"foreignKey": "userFk" "foreignKey": "userFk"
} }
} },
"scope": {
"order": ["creationDate DESC", "id DESC"]
}
} }

View File

@ -27,22 +27,22 @@
"type": "String" "type": "String"
}, },
"oldInstance": { "oldInstance": {
"type": "Object" "type": "Object"
}, },
"newInstance": { "newInstance": {
"type": "Object" "type": "Object"
}, },
"creationDate": { "creationDate": {
"type": "Date" "type": "Date"
}, },
"changedModelId": { "changedModelId": {
"type": "Number" "type": "Number"
}, },
"changedModelValue": { "changedModelValue": {
"type": "String" "type": "String"
}, },
"description": { "description": {
"type": "String" "type": "String"
} }
}, },
"relations": { "relations": {
@ -51,5 +51,8 @@
"model": "Account", "model": "Account",
"foreignKey": "userFk" "foreignKey": "userFk"
} }
} },
"scope": {
"order": ["creationDate DESC", "id DESC"]
}
} }