|
@@ -2987,7 +2987,7 @@ func (this *UserController) CompanyList() {
|
|
|
br.ErrMsg = "获取公司ID数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- condition = ` AND r.company_id IN ( ` + companyCondition + ` )AND r.create_time < date_format(now(),'%Y-%m-%d') ` //过滤当天时间
|
|
|
+ condition = ` AND r.company_id IN ( ` + companyIds + ` )AND r.create_time < date_format(now(),'%Y-%m-%d') ` //过滤当天时间
|
|
|
if keyWord != "" {
|
|
|
condition += ` AND (r.mobile LIKE '%` + keyWord + `%' OR r.email LIKE '%` + keyWord + `%' OR r.real_name LIKE '%` + keyWord + `%'` + ` OR r.company_name LIKE '%` + keyWord + `%') `
|
|
|
}
|
|
@@ -3046,6 +3046,7 @@ func (this *UserController) CompanyList() {
|
|
|
var articleIds string
|
|
|
mapAricleId := make(map[int]int)
|
|
|
mapAricleIndustrialSubjectName := make(map[int]*cygx.ArticleIndustrialSubjectNameResp)
|
|
|
+ var sellerCompanyIds []int
|
|
|
for k, v := range list {
|
|
|
if v.ArticleId >= utils.SummaryArticleId {
|
|
|
list[k].ArticleType = 1
|
|
@@ -3060,7 +3061,10 @@ func (this *UserController) CompanyList() {
|
|
|
mapAricleId[v.ArticleId] = v.ArticleId
|
|
|
}
|
|
|
list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
}
|
|
|
+
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
articleIds = strings.TrimRight(articleIds, ",")
|
|
|
if articleIds != "" {
|
|
|
listArticleIndustrialSubjectList, err := cygx.GetCygxArticleIndustrialSubjectName(articleIds)
|
|
@@ -3078,6 +3082,7 @@ func (this *UserController) CompanyList() {
|
|
|
list[k].IndustryName = mapAricleIndustrialSubjectName[v.ArticleId].IndustryName
|
|
|
list[k].SubjectNameStr = mapAricleIndustrialSubjectName[v.ArticleId].SubjectNameStr
|
|
|
}
|
|
|
+ list[k].SellerName = sellNameMap[v.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3122,6 +3127,13 @@ func (this *UserController) CompanyList() {
|
|
|
br.Msg = "获取参会人数列表失败"
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+
|
|
|
if len(list) > 0 {
|
|
|
for k, v := range list {
|
|
|
if v.ActivityType == 1 {
|
|
@@ -3138,6 +3150,7 @@ func (this *UserController) CompanyList() {
|
|
|
list[k].FirstMeetingTime = ""
|
|
|
list[k].LastMeetingTime = ""
|
|
|
}
|
|
|
+ v.SellerName = sellNameMap[v.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
} else if source == 3 {
|
|
@@ -3153,6 +3166,13 @@ func (this *UserController) CompanyList() {
|
|
|
br.ErrMsg = "获取用户搜藏记录失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+
|
|
|
if len(list) > 0 {
|
|
|
for k, v := range list {
|
|
|
if v.ArticleId >= utils.SummaryArticleId {
|
|
@@ -3160,6 +3180,7 @@ func (this *UserController) CompanyList() {
|
|
|
} else {
|
|
|
list[k].ArticleType = 2
|
|
|
}
|
|
|
+ v.SellerName = sellNameMap[v.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
} else if source == 4 {
|
|
@@ -3227,6 +3248,16 @@ func (this *UserController) CompanyList() {
|
|
|
br.Msg = "获取用户关注总数失败"
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+ for _, v := range list {
|
|
|
+ v.SellerName = sellNameMap[v.CompanyId]
|
|
|
+ }
|
|
|
+
|
|
|
} else if source == 6 {
|
|
|
total, err = cygx.GetCygArticleDepartmentFollowCountByCompany(condition)
|
|
|
if err != nil {
|
|
@@ -3241,7 +3272,15 @@ func (this *UserController) CompanyList() {
|
|
|
return
|
|
|
}
|
|
|
if len(list) > 0 {
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+
|
|
|
for k, v := range list {
|
|
|
+ v.SellerName = sellNameMap[v.CompanyId]
|
|
|
var conditionDepartment string
|
|
|
var pars []interface{}
|
|
|
conditionDepartment += ` WHERE art.source = 1 AND art.is_summary = 1 AND art.department_id = ` + strconv.Itoa(v.DepartmentId)
|
|
@@ -3322,6 +3361,17 @@ func (this *UserController) CompanyList() {
|
|
|
br.ErrMsg = "获取搜索记录列表失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+ for _, v := range list {
|
|
|
+ v.SellerName = sellNameMap[v.CompanyId]
|
|
|
+ }
|
|
|
+
|
|
|
} else if source == 10 { //标签点击记录
|
|
|
condition = ``
|
|
|
if adminId != "" {
|
|
@@ -4120,14 +4170,13 @@ func (this *UserController) TableCompanyList() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
condition += ` AND b.status IN ('正式','试用','冻结') `
|
|
|
- companyCondition := `SELECT a.company_id FROM company AS a INNER JOIN company_product AS b ON a.company_id=b.company_id WHERE a.enabled=1 `
|
|
|
+ companyCondition := ` AND a.enabled=1 `
|
|
|
if condition != "" {
|
|
|
companyCondition += condition
|
|
|
}
|
|
|
|
|
|
- condition = ` AND r.company_id IN ( ` + companyCondition + ` )AND r.create_time < date_format(now(),'%Y-%m-%d') ` //过滤当天时间
|
|
|
+ //condition = ` AND r.company_id IN ( ` + companyCondition + ` )AND r.create_time < date_format(now(),'%Y-%m-%d') ` //过滤当天时间
|
|
|
|
|
|
//historyNum, err := cygx.GetCygxArticleHistoryCountByCompany(condition)
|
|
|
//if err != nil {
|
|
@@ -4142,6 +4191,22 @@ func (this *UserController) TableCompanyList() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ lsitCompany, err := company.GetCompanyProductListBycondition(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取数据失败,GetCompanyProductListBycondition Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var companyIds []string
|
|
|
+ for _, v := range lsitCompany {
|
|
|
+ companyIds = append(companyIds, strconv.Itoa(v.CompanyId))
|
|
|
+ }
|
|
|
+ condition = " AND r.company_id IN (" + strings.Join(companyIds, ",") + ")"
|
|
|
+ condition += ` AND r.create_time < date_format(now(),'%Y-%m-%d') ` //过滤当天时间
|
|
|
+
|
|
|
historyNum, _ := strconv.Atoi(detailConfig.ConfigValue)
|
|
|
//获取参会总数
|
|
|
activityNum, err := cygx.GetActivityMeetByCompanyCount(condition)
|
|
@@ -4199,7 +4264,7 @@ func (this *UserController) TableCompanyList() {
|
|
|
br.ErrMsg = "获取搜索记录失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- tagNum, err := cygx.GetCygxTagHistoryCountByCompanyIds(companyCondition, "")
|
|
|
+ tagNum, err := cygx.GetCygxTagHistoryCountByCompanyIds(strings.Join(companyIds, ","), "")
|
|
|
if err != nil {
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
br.Msg = "获取搜索记录失败"
|