add sort
This commit is contained in:
No files matched your search
@@ -16,6 +16,7 @@ type ReadListDto struct {
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ type ReadListDto struct {
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ type ReadListDto struct {
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ type ReadListDto struct {
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Search string `json:"search"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,9 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Di
|
||||
}
|
||||
}
|
||||
|
||||
plh.SearchCodeOrName(input.Search, tx)
|
||||
tx = plh.SearchCodeOrName(input.Search, tx)
|
||||
|
||||
tx = plh.Sort(input.Sort, tx)
|
||||
|
||||
tx = tx.
|
||||
Model(&e.District{}).
|
||||
|
||||
@@ -55,6 +55,8 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Pr
|
||||
|
||||
tx = plh.SearchCodeOrName(input.Search, tx)
|
||||
|
||||
tx = plh.Sort(input.Sort, tx)
|
||||
|
||||
tx = tx.
|
||||
Model(&e.Province{}).
|
||||
Scopes(gh.Filter(input.FilterDto)).
|
||||
|
||||
@@ -55,6 +55,8 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Re
|
||||
|
||||
tx = plh.SearchCodeOrName(input.Search, tx)
|
||||
|
||||
tx = plh.Sort(input.Sort, tx)
|
||||
|
||||
tx = tx.
|
||||
Model(&e.Regency{}).
|
||||
Scopes(gh.Filter(input.FilterDto)).
|
||||
|
||||
@@ -55,6 +55,8 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.Vi
|
||||
|
||||
tx = plh.SearchCodeOrName(input.Search, tx)
|
||||
|
||||
tx = plh.Sort(input.Sort, tx)
|
||||
|
||||
tx = tx.
|
||||
Model(&e.Village{}).
|
||||
Scopes(gh.Filter(input.FilterDto)).
|
||||
|
||||
Reference in New Issue
Block a user