|
@@ -5,6 +5,7 @@ import (
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"hongze/hz_crm_api/models"
|
|
|
"hongze/hz_crm_api/models/company"
|
|
|
+ "hongze/hz_crm_api/models/overseas_custom"
|
|
|
"hongze/hz_crm_api/models/roadshow"
|
|
|
"hongze/hz_crm_api/models/system"
|
|
|
"hongze/hz_crm_api/services"
|
|
@@ -1420,12 +1421,20 @@ func (this *CalendarController) OverseasSellerReportList() {
|
|
|
tmpAllOnlineNumMap[index] += tmpOnlineNum
|
|
|
tmpAllOfflineNumMap[index] += tmpOfflineNum
|
|
|
}
|
|
|
- tmpAdminReportRecord := roadshow.OverseasAdminReportRecord{
|
|
|
- Name: researcher.RealName,
|
|
|
- AdminId: researcher.AdminId,
|
|
|
- RsReportRecordNumList: tmpAdminRsReportRecordNumList,
|
|
|
+
|
|
|
+ // 数据都为0的时候不显示
|
|
|
+ adminTotalNum := 0
|
|
|
+ for _, v := range tmpAdminRsReportRecordNumList {
|
|
|
+ adminTotalNum += v.TryOutNum + v.CloseNum + v.FormalNum
|
|
|
+ }
|
|
|
+ if adminTotalNum > 0 {
|
|
|
+ tmpAdminReportRecord := roadshow.OverseasAdminReportRecord{
|
|
|
+ Name: researcher.RealName,
|
|
|
+ AdminId: researcher.AdminId,
|
|
|
+ RsReportRecordNumList: tmpAdminRsReportRecordNumList,
|
|
|
+ }
|
|
|
+ RsReportRecordResp.List = append(RsReportRecordResp.List, tmpAdminReportRecord)
|
|
|
}
|
|
|
- RsReportRecordResp.List = append(RsReportRecordResp.List, tmpAdminReportRecord)
|
|
|
}
|
|
|
|
|
|
//总体汇总数据
|
|
@@ -1640,6 +1649,24 @@ func (this *CalendarController) OverseasCalendarList() {
|
|
|
adminIdsArr = append(adminIdsArr, id)
|
|
|
}
|
|
|
|
|
|
+ //客户状态维度
|
|
|
+ companylist, err := overseas_custom.GetOverseasCustomList("", nil)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ formalIdsArr := make([]int, 0)
|
|
|
+ tryoutIdsArr := make([]int, 0)
|
|
|
+ closeIdsArr := make([]int, 0)
|
|
|
+ for _, v := range companylist {
|
|
|
+ if v.OverseasStatus == "正式" {
|
|
|
+ formalIdsArr = append(formalIdsArr, v.CompanyId)
|
|
|
+ } else if v.OverseasStatus == "试用" {
|
|
|
+ tryoutIdsArr = append(tryoutIdsArr, v.CompanyId)
|
|
|
+ } else if v.OverseasStatus == "关闭" {
|
|
|
+ closeIdsArr = append(closeIdsArr, v.CompanyId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//正式客户
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
@@ -1666,14 +1693,14 @@ func (this *CalendarController) OverseasCalendarList() {
|
|
|
//获取列表
|
|
|
switch dataType {
|
|
|
case "try_out":
|
|
|
- condition += ` and a.company_status = ? `
|
|
|
- pars = append(pars, "试用")
|
|
|
+ condition += ` and a.company_status = ? and a.company_id IN (` + utils.GetOrmInReplace(len(tryoutIdsArr)) + `)`
|
|
|
+ pars = append(pars, "试用", tryoutIdsArr)
|
|
|
case "formal":
|
|
|
- condition += ` and a.company_status = ? `
|
|
|
- pars = append(pars, "正式")
|
|
|
+ condition += ` and a.company_status = ? and a.company_id IN (` + utils.GetOrmInReplace(len(formalIdsArr)) + `)`
|
|
|
+ pars = append(pars, "正式", formalIdsArr)
|
|
|
case "close":
|
|
|
- condition += ` and a.company_status = ? `
|
|
|
- pars = append(pars, "关闭")
|
|
|
+ condition += ` and a.company_status = ? and a.company_id IN (` + utils.GetOrmInReplace(len(closeIdsArr)) + `)`
|
|
|
+ pars = append(pars, "关闭", closeIdsArr)
|
|
|
case "online":
|
|
|
condition += ` and a.roadshow_type = ? `
|
|
|
pars = append(pars, "线上")
|