Эх сурвалжийг харах

Merge branch 'cygx/cygx_need_p2_786' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

xingzai 1 жил өмнө
parent
commit
b936aaee04

+ 8 - 0
controllers/company.go

@@ -418,6 +418,7 @@ func (this *CompanyController) SearchList() {
 // @Param   SortByTodo   query   bool  true       "是否根据待办排序,true或false"
 // @Param   TryStage   query   int  false       "试用客户子标签:0全部、1未分类、2 推进、3 跟踪、4 预备"
 // @Param   IncludeShare   query   bool  true       "是否包含共享客户: true-包含; false-不包含"
+// @Param   IsSigning   query   int  true       "是否签约过: -1-默认全部; 0-否; 1-是"
 // @Success 200 {object} company.CompanyListResp
 // @router /list [get]
 func (this *CompanyController) List() {
@@ -456,6 +457,7 @@ func (this *CompanyController) List() {
 	todoStatus := this.GetString("TodoStatus")      //任务状态
 	tryStage, _ := this.GetInt("TryStage")          //试用客户标签
 	includeShare, _ := this.GetBool("IncludeShare") // 是否包含试用客户
+	isSigning, _ := this.GetInt("IsSigning", -1)
 
 	// 套餐类型
 	packageType, _ := this.GetInt("PackageType")
@@ -563,7 +565,12 @@ func (this *CompanyController) List() {
 		citySql = strings.TrimRight(citySql, ",")
 		condition += ` AND a.city IN (` + citySql + `) `
 	}
+	//是否签约过
 
+	if isSigning == 0 || isSigning == 1 {
+		condition += ` AND b.is_signing = ?  `
+		pars = append(pars, isSigning)
+	}
 	if keyWord != "" {
 		companyIdStr, err := company.GetCompanyIdByKeyWord(keyWord)
 		if err != nil {
@@ -1721,6 +1728,7 @@ func (this *CompanyController) List() {
 				IsShare:         v.IsShare,
 				CloseTime:       v.CloseTime,
 				CloseReason:     v.CloseReason,
+				IsSigning:       v.IsSigning,
 			}
 			companyLists = append(companyLists, companyList)
 		}

+ 5 - 2
models/company/company.go

@@ -91,6 +91,7 @@ type CompanySearchItem struct {
 	ShareSellerId   int    `description:"共享销售员id"`
 	IsShare         int    `description:"0:非共享用户,1:共享客户"`
 	IsScrounge      int    `description:"是否白嫖 0不是 1是"`
+	IsSigning       int    `description:"是否签约过,1是,0否"`
 }
 
 type CompanySearchListResp struct {
@@ -100,7 +101,7 @@ type CompanySearchListResp struct {
 
 func GetCompanySearchList(condition string, pars []interface{}, limitParam ...int) (items []*CompanySearchItem, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT DISTINCT a.company_id,a.company_name,a.credit_code,a.company_code,a.region_type,a.share_seller_id,a.share_seller,a.is_share,
+	sql := `SELECT DISTINCT a.company_id,a.company_name,a.credit_code,a.company_code,a.region_type,a.share_seller_id,a.share_seller,a.is_share,b.is_signing,
             GROUP_CONCAT(b.status ORDER BY b.product_id ASC SEPARATOR '/') AS status,
 			GROUP_CONCAT(DISTINCT b.seller_name ORDER BY b.product_id ASC SEPARATOR '/' ) AS seller_name,
 			GROUP_CONCAT(DISTINCT b.seller_id ORDER BY b.product_id ASC SEPARATOR '/') AS seller_ids,
@@ -206,6 +207,7 @@ type CompanyItem struct {
 	ServiceTimes     int                  `description:"服务次数"`
 	CloseReason      string               `description:"关闭原因"`
 	CloseTime        string               `description:"关闭时间"`
+	IsSigning        int                  `description:"是否签约过,1是,0否"`
 }
 
 type CompanyListItem struct {
@@ -271,6 +273,7 @@ type CompanyListItem struct {
 	CloseReason      string               `description:"关闭客户原因"`
 	CloseTime        string               `description:"关闭客户时间"`
 	IsScrounge       int                  `description:"是否白嫖 0不是 1是"`
+	IsSigning        int                  `description:"是否签约过 0不是 1是"`
 }
 
 type TryStageSliceItem struct {
@@ -308,7 +311,7 @@ func GetCompanyList(condition, status, sortStr string, pars []interface{}, start
 	// 权益客户: 以权益最后一次阅读时间作为参考
 	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,a.is_share,
+	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,a.is_share,b.is_signing,
 			CASE 
      WHEN GROUP_CONCAT(b.status) LIKE "%永续%" THEN 1
 	 WHEN GROUP_CONCAT(b.status) LIKE "%正式%" THEN 2