|
@@ -194,7 +194,10 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
parsAscribeRai = append(parsAscribeRai, noRenewedcompanyContractIds)
|
|
|
}
|
|
|
|
|
|
- condition += ` AND c.product_id = ? AND a.status = 1 `
|
|
|
+ if dataType != "新增试用" {
|
|
|
+ condition += ` AND a.status = 1 `
|
|
|
+ }
|
|
|
+ condition += ` AND c.product_id = ? `
|
|
|
pars = append(pars, 2)
|
|
|
|
|
|
var list []*models.IncrementalList
|
|
@@ -206,6 +209,41 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
var dataTotal, trialTotal, renewalCompanyTotal int
|
|
|
var notRenewalTryOut, notRenewalNotTryOut int
|
|
|
|
|
|
+ //试用客户数
|
|
|
+ {
|
|
|
+ condition1 := condition
|
|
|
+ pars1 := pars
|
|
|
+ condition1 += ` AND a.create_time >= ? AND a.create_time <= ? AND a.operation in ("add","receive") `
|
|
|
+ pars1 = append(pars1, startDate, endDate)
|
|
|
+ total, err := models.GetIncrementalCompanyCountByOperationRecord(condition1, pars1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ trialTotal = total
|
|
|
+
|
|
|
+ if dataType == "新增试用" {
|
|
|
+ //列表数据数量
|
|
|
+ total, err := models.GetIncrementalCompanyProductCountByOperationRecord(condition1, pars1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //列表页数据
|
|
|
+ tmpList, err := models.GetIncrementalCompanyListByOperationRecord(condition1, pars1, startSize, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ list = tmpList
|
|
|
+ dataTotal = total
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//新签客户数
|
|
|
{
|
|
|
condition1 := condition
|