mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2017 from wanyaoqi/bugfix/wyq/fix-list-order-by
bugfix: fix list order by
This commit is contained in:
@@ -512,6 +512,9 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
|
||||
orderBy = append(orderBy, primaryCol.Name())
|
||||
} else if manager.TableSpec().ColumnSpec("created_at") != nil {
|
||||
orderBy = append(orderBy, "created_at")
|
||||
if primaryCol != nil {
|
||||
orderBy = append(orderBy, primaryCol.Name())
|
||||
}
|
||||
}
|
||||
for _, orderByField := range orderBy {
|
||||
colSpec := manager.TableSpec().ColumnSpec(orderByField)
|
||||
|
||||
Reference in New Issue
Block a user