作者 庄敏学

排序

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