zhou.xiaoning 3 years ago
parent
commit
78e780a5af
1 changed files with 11 additions and 1 deletions
  1. 11 1
      models/ermcp8.go

+ 11 - 1
models/ermcp8.go

@@ -1098,7 +1098,17 @@ func (r *Ermcp8HedgeditemReport) buildReportSql() string {
 	WHERE (t.TRADEUSERID = %v OR t.AREAUSERID = %v)
 	`
 	sqlId.FormatParam(r.USERID, r.USERID)
-	sqlId.And("t.CYCLETIME", r.CYCLETIME)
+	// 过滤周期类型
+	if r.CYCLETYPE == 1 {
+		// 月
+		sqlId.And("t.cycletype", 1)
+		sqlId.And("t.CYCLETIME", r.CYCLETIME)
+	} else if r.CYCLETYPE == 4 {
+		// 周
+		// 获取查询日期的当前周
+		sqlId.And("t.cycletype", 4)
+		sqlId.And("t.CYCLETIME", mtpcache.GetWeekIW(r.CYCLETIME))
+	}
 	sqlId.AndEx("t.HEDGEDTYPE", r.HEDGEDTYPE, r.HEDGEDTYPE > 0)
 	sqlId.AndEx("t.HEDGEDITEMSTATUS", r.HEDGEDITEMSTATUS, r.HEDGEDITEMSTATUS > 0)
 	sqlId.AndLike("t.HEDGEDITEMNUM", r.HEDGEDITEMNUM)