|
@@ -195,9 +195,6 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
parsAscribeRai = append(parsAscribeRai, noRenewedcompanyContractIds)
|
|
|
}
|
|
|
|
|
|
- if dataType != "新增试用" {
|
|
|
- condition += ` AND a.status = 1 `
|
|
|
- }
|
|
|
condition += ` AND c.product_id = ? `
|
|
|
pars = append(pars, 2)
|
|
|
|
|
@@ -214,7 +211,7 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
{
|
|
|
condition1 := condition
|
|
|
pars1 := pars
|
|
|
- condition1 += ` AND a.create_time >= ? AND a.create_time <= ? AND a.operation in ("add","receive") `
|
|
|
+ condition1 += ` AND a.create_time >= ? AND a.create_time <= ? AND a.operation in ("add","receive") AND b.company_id NOT IN ( SELECT company_id FROM company_operation_record WHERE product_id = 2 AND operation ="loss" GROUP BY company_id ) `
|
|
|
pars1 = append(pars1, startDate, endDate)
|
|
|
//销售筛选条件
|
|
|
if adminId != "" {
|
|
@@ -252,6 +249,9 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
|
|
|
//新签客户数
|
|
|
{
|
|
|
+
|
|
|
+ condition += ` AND a.status = 1 `
|
|
|
+
|
|
|
condition1 := condition
|
|
|
pars1 := pars
|
|
|
condition1 += ` AND a.start_date >= ? AND a.start_date <= ? `
|
|
@@ -263,6 +263,8 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
if adminId != "" {
|
|
|
condition1 += ` AND a.seller_id_init in (` + adminId + `) `
|
|
|
}
|
|
|
+
|
|
|
+ fmt.Println(condition1)
|
|
|
newCompanyTotal, err = company.GetIncrementalNewCompanyProductMergeCount(condition1, pars1)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取失败"
|
|
@@ -293,6 +295,9 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
|
|
|
//续约客户数
|
|
|
{
|
|
|
+
|
|
|
+ condition += ` AND a.status = 1 `
|
|
|
+
|
|
|
condition1 := condition
|
|
|
pars1 := pars
|
|
|
condition1 += ` AND a.start_date >= ? AND a.start_date <= ? `
|