Explorar o código

fix:营业部门排序

zqbao hai 6 meses
pai
achega
1b36d521ca
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      models/sys_department.go

+ 1 - 1
models/sys_department.go

@@ -26,7 +26,7 @@ func GetSysDepartmentById(sysDepartmentId int) (item *SysDepartment, err error)
 
 func GetChildSysDepartmentByParentId(parentId int) (items []*SysDepartment, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM sys_department WHERE parent_id = ?`
+	sql := `SELECT * FROM sys_department WHERE parent_id = ? ORDER BY sort ASC`
 	_, err = o.Raw(sql, parentId).QueryRows(&items)
 	return
 }