作者 yangfu

修改部门列表

... ... @@ -84,7 +84,7 @@ func GetDepartmentByCompanyId(companyId int64) (v []*Department, err error) {
select *
from department
where company_id =? and delete_at =0
order by parent_id,id`
order by level,id`
if _, err = o.Raw(sql, companyId).QueryRows(&v); err == nil {
return
}
... ... @@ -107,7 +107,7 @@ func GetDepartmentIdsByCompanyId(companyId int) (v []int64, err error) {
select id
from department
where company_id =? and delete_at =0
order by parent_id,id`
order by level,id`
if _, err = o.Raw(sql, companyId).QueryRows(&v); err == nil {
return
}
... ... @@ -122,7 +122,7 @@ select id from (
select department_id from user_department where user_company_id=? and enable_status = 1
)a inner join department b on a.department_id = b.id
where b.delete_at =0
order by parent_id,id`
order by b.level,b.id`
if _, err = o.Raw(sql, uid).QueryRows(&v); err == nil {
if err == orm.ErrNoRows {
err = nil
... ...