Browse Source

fix:销售统计数据修复

Roc 2 months ago
parent
commit
b1f673b254
2 changed files with 7 additions and 8 deletions
  1. 1 0
      .gitignore
  2. 6 8
      controller/census/seller.go

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@
 /log
 latest_log
 /config/config.yaml
+/config/config_release.yaml
 .DS_Store
 go.sum
 /binlog

+ 6 - 8
controller/census/seller.go

@@ -512,8 +512,6 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 	//	historyPars = append(historyPars, groupIds)
 	//}
 
-
-
 	// 获取销售分组信息
 	sellerList, e := crmService.GetSellerDepartmentListWithEnable()
 	if e != nil {
@@ -521,8 +519,8 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 		return
 	}
 
-	ficcSellerIds := make([]string,0)
-	raiSellerIds := make([]string,0)
+	ficcSellerIds := make([]string, 0)
+	raiSellerIds := make([]string, 0)
 	sellerMap := make(map[int]*crm.SellerAdminWithGroupTeam)
 	for i := range sellerList {
 		sellerMap[sellerList[i].SellerId] = sellerList[i]
@@ -532,7 +530,7 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 			raiSellerIds = append(raiSellerIds, strconv.Itoa(sellerList[i].SellerId))
 		}
 	}
-	sellerIds := make([]string,0)
+	sellerIds := make([]string, 0)
 
 	if req.SellerType == 1 {
 		//cond += ` AND b.contract_type = 1 `
@@ -755,11 +753,11 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 				//sellerIds := strings.Split(req.SellerIds, ",")
 				amountCond += ` AND (( b.seller_id IN ? AND a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
 				amountCond += `OR ( d.seller_id IN ? AND  a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)) `
-				amountPars = append(amountPars, sellerIds, st, ed, sellerIds, st, ed)
+				amountPars = append(amountPars, sellerIds, historyTime, ed, sellerIds, historyTime, ed)
 			} else {
 				amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
 				amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?))`
-				amountPars = append(amountPars, st, ed, st, ed)
+				amountPars = append(amountPars, historyTime, ed, historyTime, ed)
 			}
 			results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
 			if e != nil {
@@ -790,7 +788,7 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
 		}
 		if st != "" && ed != "" {
 			historyCond += ` AND (invoice_time BETWEEN ? AND ? )`
-			historyPars = append(historyPars, st, ed)
+			historyPars = append(historyPars, st, historyTime)
 		}
 		results, e := fms.GetIncomeHistory(historyCond, historyPars)
 		if e != nil {