Browse Source

feat:增加部门id字段

duxin 2 năm trước cách đây
mục cha
commit
62f2c6a9f3
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      jyBXSubscribe/rpc/model/entity.go

+ 2 - 2
jyBXSubscribe/rpc/model/entity.go

@@ -110,7 +110,7 @@ func JsonUnmarshal(m interface{}, s interface{}) interface{} {
 
 // 获取部门下可以进行分发的人员(不包含部门名称和部门id)
 func GetDisUsers(entId, deptId int) *[]*User {
-	r := IC.MainMysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,c.power from entniche_department_parent a 
+	r := IC.MainMysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,c.power,b.dept_id from entniche_department_parent a 
 		INNER JOIN entniche_department_user b on (b.dept_id=? or (a.pid=? and a.id=b.dept_id)) 
 		INNER JOIN entniche_user c on (c.ent_id=? and b.user_id=c.id) 
 		order by convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, deptId, deptId, entId)
@@ -123,7 +123,7 @@ func GetDisUsers(entId, deptId int) *[]*User {
 
 // 获取企业下所有的员工(不包含部门名称和部门id)
 func GetEntUsers(entId int) *[]*User {
-	r := IC.MainMysql.SelectBySql(`select * from entniche_user where ent_id=?
+	r := IC.MainMysql.SelectBySql(`select a.id,a.name,a.phone,a.power,b.dept_id from entniche_user a  LEFT JOIN entniche_department_user b on  (a.id=b.user_id )  where ent_id=?
 		order by convert(name using gbk) COLLATE gbk_chinese_ci asc`, entId)
 	users, _ := JsonUnmarshal(*r, &[]*User{}).(*[]*User)
 	if users == nil {