|
@@ -5,8 +5,6 @@ import (
|
|
util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
|
|
util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
|
|
IC "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/init"
|
|
IC "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/init"
|
|
"fmt"
|
|
"fmt"
|
|
- "log"
|
|
|
|
- "time"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
type ChatGroupService struct{}
|
|
type ChatGroupService struct{}
|
|
@@ -16,7 +14,6 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
|
|
phoneData := map[string]string{}
|
|
phoneData := map[string]string{}
|
|
nameData := map[string]string{}
|
|
nameData := map[string]string{}
|
|
positionData := map[int]string{}
|
|
positionData := map[int]string{}
|
|
- tm := time.Now()
|
|
|
|
//在职人员查询
|
|
//在职人员查询
|
|
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
|
|
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
|
|
LEFT JOIN entniche_user_role b on a.id = b.user_id
|
|
@@ -27,7 +24,6 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
|
|
nameData[common.InterfaceToStr(v["name"])] = common.InterfaceToStr(v["phone"])
|
|
nameData[common.InterfaceToStr(v["name"])] = common.InterfaceToStr(v["phone"])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.Println("查询列表耗时5:", time.Since(tm))
|
|
|
|
|
|
|
|
//离职人员查看
|
|
//离职人员查看
|
|
if isAll {
|
|
if isAll {
|
|
@@ -45,17 +41,17 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.Println("查询列表耗时6:", time.Since(tm))
|
|
|
|
|
|
|
|
//查询企业人员职位
|
|
//查询企业人员职位
|
|
- positionList := IC.BaseMysql.SelectBySql("SELECT a.phone,b.id FROM base_user a LEFT JOIN base_position b ON a.id = b.user_id WHERE b.ent_id = ?", entId)
|
|
|
|
|
|
+ positionList := IC.BaseMysql.SelectBySql(fmt.Sprintf(`SELECT b.phone,b.id FROM base_position a
|
|
|
|
+ INNER JOIN base_user b ON a.ent_id = %d
|
|
|
|
+ AND a.user_id = b.id`, entId))
|
|
if positionList != nil && len(*positionList) > 0 {
|
|
if positionList != nil && len(*positionList) > 0 {
|
|
for _, v := range *positionList {
|
|
for _, v := range *positionList {
|
|
positionData[common.IntAll(v["id"])] = phoneData[common.ObjToString(v["phone"])]
|
|
positionData[common.IntAll(v["id"])] = phoneData[common.ObjToString(v["phone"])]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.Println("查询列表耗时7:", time.Since(tm))
|
|
|
|
return phoneData, nameData, positionData
|
|
return phoneData, nameData, positionData
|
|
}
|
|
}
|
|
|
|
|