Browse Source

fix:企业管理员名称特殊处理

duxin 2 years ago
parent
commit
d289c7d2fa
2 changed files with 4 additions and 3 deletions
  1. 1 0
      entity/util.go
  2. 3 3
      service/chat_group.go

+ 1 - 0
entity/util.go

@@ -32,6 +32,7 @@ const (
 	SOCIALIZE_CUSTOMER_SERVICE_USER = "socialize_customer_service_user"
 	Socialize_summary               = "socialize_summary"
 	Socialize_customer_service_user = "socialize_customer_service_user"
+	UserRoleOne                     = "企业管理员"
 )
 const (
 	SUCCESS_CODE = int64(0)

+ 3 - 3
service/chat_group.go

@@ -15,9 +15,9 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 	nameData := map[string]string{}
 	positionData := map[int]string{}
 	//在职人员查询
-	personList := IC.MainMysql.Find(util.ENTNICHE_USER, map[string]interface{}{
-		"ent_Id": entId,
-	}, "phone,name", "", -1, -1)
+	personList := IC.MainMysql.SelectBySql(fmt.Sprintf(`SELECT a.phone,IF(a.name = "我" AND b.role_id = 1 ,"%s",a.name)  AS name,b.role_id FROM %s a
+					LEFT JOIN entniche_user_role b on a.id = b.user_id 
+					WHERE a.ent_id = %d`, util.UserRoleOne, util.ENTNICHE_USER, entId))
 	if personList != nil && len(*personList) > 0 {
 		for _, v := range *personList {
 			phoneData[common.InterfaceToStr(v["phone"])] = common.InterfaceToStr(v["name"])