瀏覽代碼

feat:修改

duxin 2 年之前
父節點
當前提交
b6b75d8a49
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      jyBXSubscribe/rpc/model/distributor.go

+ 6 - 6
jyBXSubscribe/rpc/model/distributor.go

@@ -62,7 +62,7 @@ func Distributor(region []string, entId, entUserId int) []*User {
 					//获取部门优先级
 					var ids = []int{v.Dept_id}
 					departSort(&ids, v.Dept_id)
-					Reverse(ids)
+					Reverse(&ids)
 					for _, v1 := range ids {
 						for _, v2 := range *rules {
 							if v1 == common.IntAll(v2["dept_id"]) {
@@ -167,12 +167,12 @@ func departSort(ids *[]int, deptId int) {
 }
 
 // 数组倒序函数
-func Reverse(arr []int) {
+func Reverse(arr *[]int) {
 	var temp int
-	length := len(arr)
+	length := len(*arr)
 	for i := 0; i < length/2; i++ {
-		temp = arr[i]
-		arr[i] = arr[length-1-i]
-		arr[length-1-i] = temp
+		temp = (*arr)[i]
+		(*arr)[i] = (*arr)[length-1-i]
+		(*arr)[length-1-i] = temp
 	}
 }