Browse Source

Merge branch 'CRM_15.6' into debug

# Conflicts:
#	models/company/company.go
#	services/statistic_report/company.go
zwxi 11 months ago
parent
commit
2290ef28c9
3 changed files with 27 additions and 8 deletions
  1. 25 6
      controllers/roadshow/report.go
  2. 1 1
      models/company/company.go
  3. 1 1
      services/statistic_report/company.go

+ 25 - 6
controllers/roadshow/report.go

@@ -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"
@@ -1645,6 +1646,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{}
@@ -1671,14 +1690,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, "线上")

+ 1 - 1
models/company/company.go

@@ -1762,7 +1762,7 @@ func GetShareCompanyList(condition, sortStr string, pars []interface{}, startSiz
 	t := time.Now().Local().AddDate(0, 0, -7).Format(utils.FormatDate)
 
 	sql := `SELECT a.company_id,a.company_name,a.credit_code,a.company_code,a.created_time,a.province,a.city,
-a.address,a.region_type,b.group_id,b.road_show_total,b.is_share,
+a.address,a.region_type,b.group_id,b.road_show_total,b.is_share,b.share_seller_id,b.share_seller,
 			CASE 
      WHEN GROUP_CONCAT(b.status) LIKE "%永续%" THEN 1
 	 WHEN GROUP_CONCAT(b.status) LIKE "%正式%" THEN 2

+ 1 - 1
services/statistic_report/company.go

@@ -577,7 +577,7 @@ func CompanyList(sysUser *system.Admin, req statisticModels.IncrementalCompanyLi
 				IsShow:          isShow,
 				TryStageSlice:   tryStageSlice,
 				ShareSeller:     v.ShareSeller,
-				ShareSellerId: v.ShareSellerId,
+				ShareSellerId:   v.ShareSellerId,
 				LatestServiceRecord: v.LatestServiceRecord.Format(utils.FormatDate2),
 				ServiceYears: numYearDecimal.String(),
 			}