|
@@ -72,7 +72,7 @@ var (
|
|
// GetSourceItem 获取标讯项目来源筛选项
|
|
// GetSourceItem 获取标讯项目来源筛选项
|
|
func (in *ParticipateStatistics) GetSourceItem(entId, positionId int) (result []*bxcore.SourceItem) {
|
|
func (in *ParticipateStatistics) GetSourceItem(entId, positionId int) (result []*bxcore.SourceItem) {
|
|
redisKey := "sourceItem%s_%d"
|
|
redisKey := "sourceItem%s_%d"
|
|
- query := "select distinct substring_index(source,',',-1) as `source` from participate_push_statistics where "
|
|
|
|
|
|
+ query := "select group_concat(distinct(source)) as `source` from participate_push_statistics where "
|
|
// 个人用户
|
|
// 个人用户
|
|
if entId == 0 {
|
|
if entId == 0 {
|
|
// 查职位id
|
|
// 查职位id
|
|
@@ -96,11 +96,19 @@ func (in *ParticipateStatistics) GetSourceItem(entId, positionId int) (result []
|
|
//emtpy := make([]*bxcore.SourceItem, 0)
|
|
//emtpy := make([]*bxcore.SourceItem, 0)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- for i := 0; i < len(*rs); i++ {
|
|
|
|
- value := common.ObjToString((*rs)[i]["source"])
|
|
|
|
|
|
+ existMap := map[string]struct{}{}
|
|
|
|
+ source_ := common.InterfaceToStr((*rs)[0]["source"])
|
|
|
|
+ splitSource := strings.Split(source_, ",")
|
|
|
|
+ for i := 0; i < len(splitSource); i++ {
|
|
|
|
+ value := splitSource[i]
|
|
if value == "" {
|
|
if value == "" {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ if _, ok := existMap[value]; ok {
|
|
|
|
+ continue
|
|
|
|
+ } else {
|
|
|
|
+ existMap[value] = struct{}{}
|
|
|
|
+ }
|
|
if name, ok := SourceMap[value]; ok {
|
|
if name, ok := SourceMap[value]; ok {
|
|
value_, err := strconv.Atoi(value)
|
|
value_, err := strconv.Atoi(value)
|
|
if err == nil {
|
|
if err == nil {
|