Procházet zdrojové kódy

feat: 人员查询新增商机分配权限

zhangxinlei1996 před 1 rokem
rodič
revize
d114776334
3 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 1 1
      ent/entity/department.go
  2. 1 1
      ent/entity/entinfo.go
  3. 2 0
      ent/entity/user.go

+ 1 - 1
ent/entity/department.go

@@ -79,7 +79,7 @@ func (d *Department) GetUsers(entId, deptId int) *[]*User {
 
 //获取部门下所有的员工,包含子部门
 func (d *Department) GetAllUsers(entId, deptId int, name string) *[]*User {
-	r := Mysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,e.name as role from entniche_department_parent a 
+	r := Mysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,e.name as role,c.niche_dis AS nicheDis,d.role_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) 
 		LEFT JOIN entniche_user_role d on (c.id=d.user_id) 

+ 1 - 1
ent/entity/entinfo.go

@@ -103,7 +103,7 @@ func (e *EntInfo) GetDisUsersDeptDetail(entId int) *[]*User {
 
 //获取企业下所有的员工
 func (e *EntInfo) GetUsersExcludeAdmin(entId int, name string) *[]*User {
-	r := Mysql.SelectBySql(`select a.id,a.name,a.phone,c.name as role from entniche_user a
+	r := Mysql.SelectBySql(`select a.id,a.name,a.phone,c.name as role,a.niche_dis as nicheDis,b.role_id from entniche_user a
 		LEFT JOIN entniche_user_role b on (a.id=b.user_id) 
 		LEFT JOIN entniche_role c on (c.id=b.role_id) 
 		where a.ent_id=? and (b.role_id<>? or b.role_id is null) and (a.name LIKE ? or a.phone LIKE ?)

+ 2 - 0
ent/entity/user.go

@@ -31,6 +31,8 @@ type User struct {
 	Dept_name string //部门名称
 	Role      string //角色
 	Power     int    //权限
+	NicheDis  int    //商机分配权限
+	Role_id   int
 }
 
 type CompletionUserInfo struct {