修复AscPk()写成Asc()的问题

This commit is contained in:
GoEdgeLab
2023-05-12 15:34:18 +08:00
parent 6146ffdf56
commit 667628aff3
4 changed files with 5 additions and 5 deletions

View File

@@ -297,8 +297,8 @@ func (this *NodeTaskDAO) FindAllDoingNodeTasksWithClusterId(tx *dbs.Tx, role str
Gt("nodeId", 0). Gt("nodeId", 0).
Where("(isDone=0 OR (isDone=1 AND isOk=0))"). Where("(isDone=0 OR (isDone=1 AND isOk=0))").
Desc("isDone"). Desc("isDone").
Asc().
Asc("nodeId"). Asc("nodeId").
AscPk().
Slice(&result). Slice(&result).
FindAll() FindAll()
return return

View File

@@ -122,7 +122,7 @@ func (this *RegionProvinceDAO) FindAllEnabledProvincesWithCountryId(tx *dbs.Tx,
_, err = this.Query(tx). _, err = this.Query(tx).
State(RegionProvinceStateEnabled). State(RegionProvinceStateEnabled).
Attr("countryId", countryId). Attr("countryId", countryId).
Asc(). AscPk().
Slice(&result). Slice(&result).
FindAll() FindAll()
return return
@@ -132,7 +132,7 @@ func (this *RegionProvinceDAO) FindAllEnabledProvincesWithCountryId(tx *dbs.Tx,
func (this *RegionProvinceDAO) FindAllEnabledProvinces(tx *dbs.Tx) (result []*RegionProvince, err error) { func (this *RegionProvinceDAO) FindAllEnabledProvinces(tx *dbs.Tx) (result []*RegionProvince, err error) {
_, err = this.Query(tx). _, err = this.Query(tx).
State(RegionProvinceStateEnabled). State(RegionProvinceStateEnabled).
Asc(). AscPk().
Slice(&result). Slice(&result).
FindAll() FindAll()
return return

View File

@@ -51,7 +51,7 @@ func (this *SysEventDAO) CreateEvent(tx *dbs.Tx, event EventInterface) error {
// 查找事件 // 查找事件
func (this *SysEventDAO) FindEvents(tx *dbs.Tx, size int64) (result []*SysEvent, err error) { func (this *SysEventDAO) FindEvents(tx *dbs.Tx, size int64) (result []*SysEvent, err error) {
_, err = this.Query(tx). _, err = this.Query(tx).
Asc(). AscPk().
Limit(size). Limit(size).
Slice(&result). Slice(&result).
FindAll() FindAll()

View File

@@ -82,7 +82,7 @@ func (this *UpdatingServerListDAO) FindLists(tx *dbs.Tx, clusterIds []int64, las
_, err = this.Query(tx). _, err = this.Query(tx).
Attr("clusterId", clusterIds). // 即使clusterIds数量是变化的这里也不需要使用Reuse(false)因为clusterIds通常数量有限 Attr("clusterId", clusterIds). // 即使clusterIds数量是变化的这里也不需要使用Reuse(false)因为clusterIds通常数量有限
Gt("id", lastId). Gt("id", lastId).
Asc(). // 非常重要 AscPk(). // 非常重要
Slice(&result). Slice(&result).
FindAll() FindAll()
return return