|
@@ -145,74 +145,74 @@ func GetCompanySearchCount(condition string, pars []interface{}) (count int, err
|
|
|
}
|
|
|
|
|
|
type CompanyItem struct {
|
|
|
- CompanyId int `orm:"column(company_id);pk"`
|
|
|
- CompanyName string `description:"客户名称"`
|
|
|
- CreditCode string `description:"社会统一信用码"`
|
|
|
- CompanyCode string `description:"客户编码"`
|
|
|
- StartDate string `description:"合同开始日期"`
|
|
|
- EndDate string `description:"合同结束日期"`
|
|
|
- LoseReason string `description:"流失原因"`
|
|
|
- RenewalReason string `description:"续约说明"`
|
|
|
- FreezeReason string `description:"冻结理由"`
|
|
|
- LossTime string `description:"流失时间"`
|
|
|
- Status string `description:"客户状态:'试用','永续','冻结','流失','正式' "`
|
|
|
- StatusStr string `description:"客户状态:'试用','永续','冻结','流失','正式' 如果是共享客户会加上 '(共享)'" `
|
|
|
- CompanyType string `description:"客户类型:ficc/权益"`
|
|
|
- ApproveStatus string `description:"审批状态:'待审批','已审批','驳回' 审批状态为空时,表示没有审批申请"`
|
|
|
- SellerName string `description:"销售:吉根龙/颖丹"`
|
|
|
- SellerId int `description:"销售ID"`
|
|
|
- SellerIds string `description:"销售ID集合,包含ficc和权益的销售id"`
|
|
|
- ShareSeller string `description:"共享销售员"`
|
|
|
- ShareSellerId int `description:"共享销售员id"`
|
|
|
- ShareSellerIds string `description:"共享销售员ids"`
|
|
|
- PackageTypes string `description:"套餐类型集合,包含ficc和权益的套餐类型" json:"-"`
|
|
|
- FiccPackageType int `description:"ficc的套餐类型"`
|
|
|
- ExpireDay string `description:"到期天数"`
|
|
|
- FreezeTime string `description:"冻结时间"`
|
|
|
- GroupId int `description:"分组id"`
|
|
|
- GroupIds string `description:"分组id集合,包含ficc和权益的小组id" json:"-"`
|
|
|
- DepartmentId int `description:"部门id"`
|
|
|
- IndustryName string `description:"所属行业"`
|
|
|
- IsSuspend int `description:"是否暂停:1:暂停,0:启用 "`
|
|
|
- CreatedTime string `description:"创建时间"`
|
|
|
- Source string `description:"客户来源"`
|
|
|
- Province string `description:"省"`
|
|
|
- City string `description:"市"`
|
|
|
- Address string `description:"详细地址"`
|
|
|
- Reasons string `description:"新增理由"`
|
|
|
- FreezeStartDate string `description:"冻结开始日期"`
|
|
|
- FreezeEndDate string `description:"冻结结束日期"`
|
|
|
- FreezeExpireDays int `description:"冻结到期天数"`
|
|
|
- BtnItem *ButtonPermission
|
|
|
- ProductId int `json:"-"`
|
|
|
- ProductIds string `description:"产品id集合,包含ficc和权益的产品id" json:"-"`
|
|
|
- FormalTime string `description:"转正时间"`
|
|
|
- IsShared bool `description:"是否共享客户"`
|
|
|
- RegionType string `description:"区域:国内,海外"`
|
|
|
- FiccLastViewTime string `description:"ficc最近一次阅读时间"`
|
|
|
- RaiLastViewTime string `description:"权益最近一次阅读时间"`
|
|
|
- ViewTotals string `description:"阅读次数集合,包含ficc和权益的阅读次数" json:"-"`
|
|
|
- LastViewTimes string `description:"最近一次阅读时间集合,包含ficc和权益的最近一次阅读时间" json:"-"`
|
|
|
- FiccView int `description:"Ficc报告阅读次数" json:"-"`
|
|
|
- RaiView int `description:"权益报告阅读次数" json:"-"`
|
|
|
- RoadShowTotal int `description:"累计路演次数"`
|
|
|
- TodoStatuss string `description:"任务状态"`
|
|
|
- TryStageStr string `description:"试用客户子标签"`
|
|
|
- TryStageSlice []*TryStageSliceItem `description:"试用状态相关"`
|
|
|
- AllViewTotal int `description:"总阅读数"`
|
|
|
- Deadline string `description:"未完成的todo任务的截止日期,截止目前还剩余的天数"`
|
|
|
- TodoEndTimeStr string `description:"未完成的todo任务的截止日期拼接格式"`
|
|
|
- TodoEndTime time.Time `description:"未完成的todo任务的截止日期"`
|
|
|
- TryOutDayTotals string `description:"试用天数集合,包含ficc和权益的试用天数" json:"-"`
|
|
|
- FiccTryOutDay int `description:"Ficc试用天数" json:"-"`
|
|
|
- RaiTryOutDay int `description:"权益试用天数" json:"-"`
|
|
|
- WeekViewActive int `description:"周阅读活跃: 0-七日内无阅读; 1-活跃"`
|
|
|
- IsShare int `description:"0:非共享用户,1:共享客户"`
|
|
|
- LastServiceTime string `description:"最后服务时间"`
|
|
|
- ServiceTimes int `description:"服务次数"`
|
|
|
- CloseReason string `description:"关闭原因"`
|
|
|
- CloseTime string `description:"关闭时间"`
|
|
|
- Nation string `description:"所属国家"`
|
|
|
+ CompanyId int `orm:"column(company_id);pk"`
|
|
|
+ CompanyName string `description:"客户名称"`
|
|
|
+ CreditCode string `description:"社会统一信用码"`
|
|
|
+ CompanyCode string `description:"客户编码"`
|
|
|
+ StartDate string `description:"合同开始日期"`
|
|
|
+ EndDate string `description:"合同结束日期"`
|
|
|
+ LoseReason string `description:"流失原因"`
|
|
|
+ RenewalReason string `description:"续约说明"`
|
|
|
+ FreezeReason string `description:"冻结理由"`
|
|
|
+ LossTime string `description:"流失时间"`
|
|
|
+ Status string `description:"客户状态:'试用','永续','冻结','流失','正式' "`
|
|
|
+ StatusStr string `description:"客户状态:'试用','永续','冻结','流失','正式' 如果是共享客户会加上 '(共享)'" `
|
|
|
+ CompanyType string `description:"客户类型:ficc/权益"`
|
|
|
+ ApproveStatus string `description:"审批状态:'待审批','已审批','驳回' 审批状态为空时,表示没有审批申请"`
|
|
|
+ SellerName string `description:"销售:吉根龙/颖丹"`
|
|
|
+ SellerId int `description:"销售ID"`
|
|
|
+ SellerIds string `description:"销售ID集合,包含ficc和权益的销售id"`
|
|
|
+ ShareSeller string `description:"共享销售员"`
|
|
|
+ ShareSellerId int `description:"共享销售员id"`
|
|
|
+ ShareSellerIds string `description:"共享销售员ids"`
|
|
|
+ PackageTypes string `description:"套餐类型集合,包含ficc和权益的套餐类型" json:"-"`
|
|
|
+ FiccPackageType int `description:"ficc的套餐类型"`
|
|
|
+ ExpireDay string `description:"到期天数"`
|
|
|
+ FreezeTime string `description:"冻结时间"`
|
|
|
+ GroupId int `description:"分组id"`
|
|
|
+ GroupIds string `description:"分组id集合,包含ficc和权益的小组id" json:"-"`
|
|
|
+ DepartmentId int `description:"部门id"`
|
|
|
+ IndustryName string `description:"所属行业"`
|
|
|
+ IsSuspend int `description:"是否暂停:1:暂停,0:启用 "`
|
|
|
+ CreatedTime string `description:"创建时间"`
|
|
|
+ Source string `description:"客户来源"`
|
|
|
+ Province string `description:"省"`
|
|
|
+ City string `description:"市"`
|
|
|
+ Address string `description:"详细地址"`
|
|
|
+ Reasons string `description:"新增理由"`
|
|
|
+ FreezeStartDate string `description:"冻结开始日期"`
|
|
|
+ FreezeEndDate string `description:"冻结结束日期"`
|
|
|
+ FreezeExpireDays int `description:"冻结到期天数"`
|
|
|
+ BtnItem *ButtonPermission
|
|
|
+ ProductId int `json:"-"`
|
|
|
+ ProductIds string `description:"产品id集合,包含ficc和权益的产品id" json:"-"`
|
|
|
+ FormalTime string `description:"转正时间"`
|
|
|
+ IsShared bool `description:"是否共享客户"`
|
|
|
+ RegionType string `description:"区域:国内,海外"`
|
|
|
+ FiccLastViewTime string `description:"ficc最近一次阅读时间"`
|
|
|
+ RaiLastViewTime string `description:"权益最近一次阅读时间"`
|
|
|
+ ViewTotals string `description:"阅读次数集合,包含ficc和权益的阅读次数" json:"-"`
|
|
|
+ LastViewTimes string `description:"最近一次阅读时间集合,包含ficc和权益的最近一次阅读时间" json:"-"`
|
|
|
+ FiccView int `description:"Ficc报告阅读次数" json:"-"`
|
|
|
+ RaiView int `description:"权益报告阅读次数" json:"-"`
|
|
|
+ RoadShowTotal int `description:"累计路演次数"`
|
|
|
+ TodoStatuss string `description:"任务状态"`
|
|
|
+ TryStageStr string `description:"试用客户子标签"`
|
|
|
+ TryStageSlice []*TryStageSliceItem `description:"试用状态相关"`
|
|
|
+ AllViewTotal int `description:"总阅读数"`
|
|
|
+ Deadline string `description:"未完成的todo任务的截止日期,截止目前还剩余的天数"`
|
|
|
+ TodoEndTimeStr string `description:"未完成的todo任务的截止日期拼接格式"`
|
|
|
+ TodoEndTime time.Time `description:"未完成的todo任务的截止日期"`
|
|
|
+ TryOutDayTotals string `description:"试用天数集合,包含ficc和权益的试用天数" json:"-"`
|
|
|
+ FiccTryOutDay int `description:"Ficc试用天数" json:"-"`
|
|
|
+ RaiTryOutDay int `description:"权益试用天数" json:"-"`
|
|
|
+ WeekViewActive int `description:"周阅读活跃: 0-七日内无阅读; 1-活跃"`
|
|
|
+ IsShare int `description:"0:非共享用户,1:共享客户"`
|
|
|
+ LastServiceTime string `description:"最后服务时间"`
|
|
|
+ ServiceTimes int `description:"服务次数"`
|
|
|
+ CloseReason string `description:"关闭原因"`
|
|
|
+ CloseTime string `description:"关闭时间"`
|
|
|
+ Nation string `description:"所属国家"`
|
|
|
LatestServiceRecord time.Time `description:"最近沟通时间"`
|
|
|
FirstDate time.Time `description:"首次服务时间"`
|
|
|
}
|
|
@@ -690,6 +690,24 @@ func GetCompanyTryOutCount(status string, sellerId int) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// 获取权益销售开通的非研选试用客户数量
|
|
|
+func GetRaiCompanyTryOutCountNoResearch(sellerId int) (count int, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ COUNT( DISTINCT a.company_id ) AS count
|
|
|
+ FROM
|
|
|
+ company AS a
|
|
|
+ INNER JOIN company_product AS b ON a.company_id = b.company_id
|
|
|
+ INNER JOIN company_report_permission AS p ON p.company_id = a.company_id
|
|
|
+ WHERE
|
|
|
+ b.status = '试用'
|
|
|
+ AND p.status = '试用'
|
|
|
+ AND b.seller_id = ?
|
|
|
+ AND p.chart_permission_id NOT IN(31,52) `
|
|
|
+ err = o.Raw(sql, sellerId).QueryRow(&count)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type CompanySearchResp struct {
|
|
|
List []*CompanyItem
|
|
|
}
|