|
@@ -1055,6 +1055,23 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
historyCond += ` AND new_company = 0 `
|
|
|
}
|
|
|
|
|
|
+ // 套餐筛选
|
|
|
+ if req.ServiceTypes != "" {
|
|
|
+ serviceTypes := strings.Split(req.ServiceTypes, ",")
|
|
|
+ registerIds, e := fms.GetContractRegisterIdsByTempId(serviceTypes)
|
|
|
+ if e != nil {
|
|
|
+ err = fmt.Errorf("获取合同登记IDs失败, Err: %s", e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(registerIds) > 0 {
|
|
|
+ cond += ` AND b.contract_register_id IN ?`
|
|
|
+ pars = append(pars, registerIds)
|
|
|
+ } else {
|
|
|
+ cond += ` AND 1 = 2`
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
var latestTime time.Time
|
|
|
|
|
|
invoiceItem, err := fms.GetLatestIncome(cond, pars)
|
|
@@ -1202,6 +1219,23 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
historyPars = append(historyPars, sellerIds)
|
|
|
prevHistoryPars = append(prevHistoryPars, sellerIds)
|
|
|
}
|
|
|
+
|
|
|
+ // 套餐筛选
|
|
|
+ if req.ServiceTypes != "" {
|
|
|
+ serviceTypes := strings.Split(req.ServiceTypes, ",")
|
|
|
+ registerIds, e := fms.GetContractRegisterIdsByTempId(serviceTypes)
|
|
|
+ if e != nil {
|
|
|
+ err = fmt.Errorf("获取合同登记IDs失败, Err: %s", e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(registerIds) > 0 {
|
|
|
+ cond += ` AND a.register_id IN ?`
|
|
|
+ pars = append(pars, registerIds)
|
|
|
+ } else {
|
|
|
+ cond += ` AND 1 = 2`
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//fmt.Println("i:",i)
|
|
|
//fmt.Println("j:",j)
|
|
|
{
|