فهرست منبع

fix(*): 总部销售统计逻辑调整

likai 1 سال پیش
والد
کامیت
b0797204f8
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      opms_parent/app/service/home/report.go

+ 2 - 2
opms_parent/app/service/home/report.go

@@ -132,11 +132,11 @@ func getCompanyContractReportData(ctx context.Context, dataType string, params *
 		if searchType == "month" {
 			dateWhere1 = fmt.Sprintf("ctr_contract.contract_start_time LIKE '%v'", date.Format("Y-m")+"-%")
 			dateWhere2 = fmt.Sprintf("ctr_contract_collection.collection_datetime LIKE '%v'", date.Format("Y-m")+"-%")
-			dateWhere3 = fmt.Sprintf("monthly=%v", date.Month())
+			dateWhere3 = fmt.Sprintf("monthly=%v AND created_time LIKE '%v%%'", date.Month(), date.Format("Y"))
 		} else if searchType == "quarter" {
 			dateWhere1 = getQuarterWhere(date, "ctr_contract.contract_start_time")
 			dateWhere2 = getQuarterWhere(date, "ctr_contract_collection.collection_datetime")
-			dateWhere3 = getQuarterMonthWhere(date, "monthly")
+			dateWhere3 = getQuarterMonthWhere(date, "monthly") + fmt.Sprintf(" AND created_time LIKE '%v%%'", date.Format("Y"))
 		}
 	}
 	// 统计字段