zwxi 1 年之前
父节点
当前提交
8975994fc6
共有 1 个文件被更改,包括 18 次插入1 次删除
  1. 18 1
      controller/census/invoice_payment.go

+ 18 - 1
controller/census/invoice_payment.go

@@ -1064,7 +1064,7 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
 			return
 		}
 		if len(registerIds) > 0 {
-			cond += ` AND a.register_id IN ?`
+			cond += ` AND b.contract_register_id IN ?`
 			pars = append(pars, registerIds)
 		} else {
 			cond += ` AND 1 = 2`
@@ -1219,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)
 		{