dengbiao 2 kuukautta sitten
vanhempi
commit
d6f3d8f974
2 muutettua tiedostoa jossa 23 lisäystä ja 16 poistoa
  1. +12
    -8
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +11
    -8
      app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go

+ 12
- 8
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go Näytä tiedosto

@@ -1773,16 +1773,20 @@ func CentralKitchenForSchoolClassSort(c *gin.Context) {
e.OutErr(c, e.ERR_INVALID_ARGS, err)
return
}

classDb := db.ClassDb{}
classDb.Set(0)
class, err := classDb.FindClassById(ClassSortArgs.Ids)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
for k, v := range *class {
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + (1000 - k)
_, err1 := classDb.ClassUpdate(&v, "sort")
for k, v := range ClassSortArgs.Ids {
class, err := classDb.GetClass(v)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if class == nil {
continue
}
class.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + k
_, err1 := classDb.ClassUpdate(class, "sort")
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return


+ 11
- 8
app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go Näytä tiedosto

@@ -637,14 +637,17 @@ func SelfSupportForSchoolClassSort(c *gin.Context) {
}
classDb := db.ClassDb{}
classDb.Set(0)
class, err := classDb.FindClassById(ClassSortArgs.Ids)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
for k, v := range *class {
v.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + (1000 - k)
_, err1 := classDb.ClassUpdate(&v, "sort")
for k, v := range ClassSortArgs.Ids {
class, err := classDb.GetClass(v)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if class == nil {
continue
}
class.Sort = (ClassSortArgs.Page-1)*ClassSortArgs.Limit + k
_, err1 := classDb.ClassUpdate(class, "sort")
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return


Ladataan…
Peruuta
Tallenna