作者 庄敏学

排序

... ... @@ -162,7 +162,7 @@ func (repository *AppPageRepository) Find(ctx context.Context, conn transaction.
total int64
)
queryFunc := func() (interface{}, error) {
tx = tx.Model(&ms).Order("id desc")
tx = tx.Model(&ms).Order("updated_at desc")
if v, ok := queryOptions["tenantId"]; ok {
tx.Where("tenant_id = ?", v)
}
... ...
... ... @@ -119,7 +119,7 @@ func (repository *ChartRepository) Find(ctx context.Context, conn transaction.Co
total int64
)
queryFunc := func() (interface{}, error) {
tx = tx.Model(&ms).Order("id desc") //.Order("pid asc").Order("sort asc")
tx = tx.Model(&ms).Order("updated_at desc") //.Order("pid asc").Order("sort asc")
if v, ok := queryOptions["ids"]; ok {
tx.Where("id in (?)", v)
}
... ...