zwxi 1 year ago
parent
commit
0632065f98
1 changed files with 4 additions and 18 deletions
  1. 4 18
      controller/census/seller.go

+ 4 - 18
controller/census/seller.go

@@ -471,35 +471,21 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 	}
 
 	var totalMoneySlice []float64
-	var reqStartDate, reqEndDate time.Time
 	historyTime, _ := time.Parse(utils.FormatDate, "2023-04-01")
 
-	if req.StartDate != "" && req.EndDate != "" {
-		st := fmt.Sprint(req.StartDate, "-01 00:00:00")
-		ed := fmt.Sprint(req.EndDate, "-01 23:59:59")
-		reqStartDate, _ = time.Parse(utils.FormatDateTime, st)
-		reqEndDate, _ = time.Parse(utils.FormatDateTime, ed)
-	}
 
 	// 累计值
 	var accumulate float64
 
-	var prevStartDate string
 	var startDate, endDate string
 	//开始日期
 	if req.StartDate != "" && req.EndDate != "" {
-		startDate = reqStartDate.Format("2006-01")
-		prevStartDate = reqStartDate.Format("2006-01")
+		startDate = fmt.Sprint(req.StartDate, " 00:00:00")
+		endDate = fmt.Sprint(req.EndDate, " 23:59:59")
 	}
-	startDate = fmt.Sprint(startDate, "-01")
-	prevStartDate = fmt.Sprint(prevStartDate, "-01")
 	startDateTime, _ := time.Parse(utils.FormatDate, startDate)
 	endDateTime, _ := time.Parse(utils.FormatDate, endDate)
 
-	//结束日期
-	if req.StartDate != "" && req.EndDate != "" {
-		endDate = reqEndDate.Format("2006-01")
-	}
 
 	cond := ` 1 = 1 `
 	historyCond := ` 1=1 `
@@ -556,8 +542,8 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 	//	prevHistoryPars = append(prevHistoryPars, sellerIds)
 	//}
 
-	st := fmt.Sprint(startDate, " 00:00:00")
-	ed := fmt.Sprint(endDate, " 23:59:59")
+	st := startDate
+	ed := endDate
 	groupInvoiceMap := make(map[int]float64)
 	sellerInvoiceMap := make(map[int]float64)
 	sellerGroupMap := make(map[int]int)