@@ -1762,9 +1762,9 @@ func CentralKitchenForSchoolClassList(c *gin.Context) { | |||||
} | } | ||||
type CentralKitchenForSchoolClassSortArgs struct { | type CentralKitchenForSchoolClassSortArgs struct { | ||||
Ids []string `json:"ids" binding:"required"` | |||||
Page int `json:"page" binding:"required"` | |||||
Limit int `json:"limit" binding:"required"` | |||||
Ids []int `json:"ids" binding:"required"` | |||||
Page int `json:"page" binding:"required"` | |||||
Limit int `json:"limit" binding:"required"` | |||||
} | } | ||||
func CentralKitchenForSchoolClassSort(c *gin.Context) { | func CentralKitchenForSchoolClassSort(c *gin.Context) { | ||||
@@ -1781,7 +1781,7 @@ func CentralKitchenForSchoolClassSort(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
for k, v := range *class { | for k, v := range *class { | ||||
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + k | |||||
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + (1000 - k) | |||||
_, err1 := classDb.ClassUpdate(&v, "sort") | _, err1 := classDb.ClassUpdate(&v, "sort") | ||||
if err1 != nil { | if err1 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | ||||
@@ -624,9 +624,9 @@ func SelfSupportForSchoolClassList(c *gin.Context) { | |||||
} | } | ||||
type SelfSupportForSchoolClassSortArgs struct { | type SelfSupportForSchoolClassSortArgs struct { | ||||
Ids []string `json:"ids" binding:"required"` | |||||
Page int `json:"page" binding:"required"` | |||||
Limit int `json:"limit" binding:"required"` | |||||
Ids []int `json:"ids" binding:"required"` | |||||
Page int `json:"page" binding:"required"` | |||||
Limit int `json:"limit" binding:"required"` | |||||
} | } | ||||
func SelfSupportForSchoolClassSort(c *gin.Context) { | func SelfSupportForSchoolClassSort(c *gin.Context) { | ||||
@@ -643,7 +643,7 @@ func SelfSupportForSchoolClassSort(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
for k, v := range *class { | for k, v := range *class { | ||||
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + k | |||||
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + (1000 - k) | |||||
_, err1 := classDb.ClassUpdate(&v, "sort") | _, err1 := classDb.ClassUpdate(&v, "sort") | ||||
if err1 != nil { | if err1 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | e.OutErr(c, e.ERR_DB_ORM, err1.Error()) | ||||