|
@@ -152,16 +152,6 @@ func getCensusIncomeChartList(ch chan models.CensusIncomeChartResp, req fms.Inco
|
|
|
} else {
|
|
|
cond += ` AND 1 = 2`
|
|
|
}
|
|
|
- // 勾选套餐筛选时忽略导入的历史数据
|
|
|
- if req.StartDate == "" {
|
|
|
- req.StartDate = "2023-04"
|
|
|
- req.EndDate = "3023-04"
|
|
|
- } else {
|
|
|
- startDateTime, _ := time.Parse(utils.FormatMonth, req.StartDate)
|
|
|
- if startDateTime.Before(historyTime) {
|
|
|
- req.StartDate = "2023-04"
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
if req.StartDate != "" && req.EndDate != "" {
|
|
@@ -198,6 +188,18 @@ func getCensusIncomeChartList(ch chan models.CensusIncomeChartResp, req fms.Inco
|
|
|
//} else if req.ListParam == "3" {
|
|
|
// numMonth = numMonth / 12
|
|
|
//}
|
|
|
+
|
|
|
+ // 勾选套餐筛选时忽略导入的历史数据
|
|
|
+ //if req.StartDate == "" {
|
|
|
+ // req.StartDate = "2023-04"
|
|
|
+ // req.EndDate = "3023-04"
|
|
|
+ //} else {
|
|
|
+ // startDateTime, _ := time.Parse(utils.FormatMonth, req.StartDate)
|
|
|
+ // if startDateTime.Before(historyTime) {
|
|
|
+ // req.StartDate = "2023-04"
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
// 累计值
|
|
|
var accumulate float64
|
|
|
var partAccumulate float64
|
|
@@ -296,7 +298,7 @@ func getCensusIncomeChartList(ch chan models.CensusIncomeChartResp, req fms.Inco
|
|
|
cond += ` AND a.register_id IN ?`
|
|
|
prevCond += ` AND a.register_id IN ?`
|
|
|
pars = append(pars, registerIds)
|
|
|
- prevPars = append(pars, registerIds)
|
|
|
+ prevPars = append(prevPars, registerIds)
|
|
|
} else {
|
|
|
cond += ` AND 1 = 2`
|
|
|
prevCond += ` AND 1 = 2`
|
|
@@ -371,6 +373,10 @@ func getCensusIncomeChartList(ch chan models.CensusIncomeChartResp, req fms.Inco
|
|
|
//fmt.Println("旧查询")
|
|
|
//fmt.Println("st:",st)
|
|
|
//fmt.Println("ed:",ed)
|
|
|
+ if req.ServiceTypes != "" {
|
|
|
+ // 勾选套餐筛选时忽略导入的历史数据
|
|
|
+ histrtyCond += ` AND 1=2 `
|
|
|
+ }
|
|
|
histrtyCond += ` AND (invoice_time BETWEEN ? AND ? )`
|
|
|
historyPars = append(historyPars, st, ed)
|
|
|
//fmt.Println("st:",st)
|
|
@@ -474,6 +480,10 @@ func getCensusIncomeChartList(ch chan models.CensusIncomeChartResp, req fms.Inco
|
|
|
// 全部走旧查询
|
|
|
fmt.Println("prevSt:", prevSt)
|
|
|
fmt.Println("prevEd:", prevEd)
|
|
|
+ if req.ServiceTypes != "" {
|
|
|
+ // 勾选套餐筛选时忽略导入的历史数据
|
|
|
+ prevHistoryCond += ` AND 1=2 `
|
|
|
+ }
|
|
|
prevHistoryCond += ` AND (invoice_time BETWEEN ? AND ?)` // 查询条件加入旧的时间范围
|
|
|
prevHistoryPars = append(prevHistoryPars, prevSt, prevEd) // 添加时间参数到参数列表
|
|
|
// 开票到款金额合计(换算后)
|