|
@@ -60,9 +60,10 @@ func Distributor(region []string, entId, entUserId int) []*User {
|
|
|
if rules != nil && len(*rules) > 0 {
|
|
|
if len(*rules) > 1 { //多条规则 查询优先级最高的规则
|
|
|
//获取部门优先级
|
|
|
- var ids = []int{v.Dept_id}
|
|
|
+ var ids []int
|
|
|
departSort(&ids, v.Dept_id)
|
|
|
- Reverse(&ids)
|
|
|
+ ids = append(ids, v.Dept_id)
|
|
|
+ //Reverse(&ids)
|
|
|
for _, v1 := range ids {
|
|
|
for _, v2 := range *rules {
|
|
|
if v1 == common.IntAll(v2["dept_id"]) {
|
|
@@ -160,8 +161,8 @@ func departSort(ids *[]int, deptId int) {
|
|
|
if list != nil && len(*list) > 0 {
|
|
|
pid := common.IntAll((*list)["pid"])
|
|
|
if pid != 0 {
|
|
|
- *ids = append(*ids, pid)
|
|
|
departSort(ids, pid)
|
|
|
+ *ids = append(*ids, pid)
|
|
|
}
|
|
|
}
|
|
|
}
|