Explorar o código

Merge branch 'dev_v1.0.10_wh' of BaseService/biService into feature/v1.0.10

王浩 hai 1 ano
pai
achega
d1cc26fcbe
Modificáronse 1 ficheiros con 12 adicións e 7 borrados
  1. 12 7
      service/infoService.go

+ 12 - 7
service/infoService.go

@@ -19,14 +19,18 @@ func (l *InfoService) Myinfo(sid string) map[string]string {
 	info_i := redis.Get("session", sid)
 	if info_i != nil {
 		info_m, _ := info_i.(map[string]interface{})
-		entRole := common.Int64All(info_m["entRole"])
 		entNicheDis := common.Int64All(info_m["entNicheDis"])
-		if entRole == 1 {
-			//	企业管理员
-			entNicheDis = 1
-		} else if entRole == 2 {
-			//部门管理员
-			entNicheDis = 2
+		depIDArr := ""
+		if entNicheDis > 0 {
+			//查询所有部门标识
+			entId := gconv.String(info_m["entId"])
+			entDeptId := gconv.String(info_m["entDeptId"])
+			deptArr := entity.JyMysql.SelectBySql("select GROUP_CONCAT(DISTINCT b.id)  as depIDArr from entniche_department_parent a"+
+				"     INNER JOIN entniche_department b "+
+				"on (b.ent_id=? and (b.id=? or (a.pid=? and a.id=b.id)))", entId, entDeptId, entDeptId)
+			if len(*deptArr) > 0 {
+				depIDArr = common.InterfaceToStr((*deptArr)[0]["depIDArr"])
+			}
 		}
 		infoMap = map[string]string{
 			"nickName":     RsaEncrypt([]byte(gconv.String(info_m["s_nickname"]))),
@@ -41,6 +45,7 @@ func (l *InfoService) Myinfo(sid string) map[string]string {
 			"entUserId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entUserId"])))),
 			"userId":       RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["base_user_id"])))),
 			"entDeptId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entDeptId"])))),
+			"entChildDept": RsaEncrypt([]byte(depIDArr)),
 		}
 	}
 	return infoMap