Browse Source

Merge branch 'feature/eta_1.3.8' into debug

hsun 1 year ago
parent
commit
66be9cbfac
2 changed files with 8 additions and 1 deletions
  1. 7 1
      controllers/report_approve/report_approve.go
  2. 1 0
      services/report_approve.go

+ 7 - 1
controllers/report_approve/report_approve.go

@@ -102,6 +102,7 @@ func (this *ReportApproveController) List() {
 	respTotal := 0
 	respList := make([]*report_approve.ReportApproveItem, 0)
 	timeField := map[int]string{1: fmt.Sprintf("a.%s", report_approve.ReportApproveCols.CreateTime), 2: fmt.Sprintf("b.%s", report_approve.ReportApproveRecordCols.ApproveTime), 3: fmt.Sprintf("b.%s", report_approve.ReportApproveCols.ApproveTime)}
+	mineTimeField := map[int]string{1: fmt.Sprintf("%s", report_approve.ReportApproveCols.CreateTime), 3: fmt.Sprintf("%s", report_approve.ReportApproveCols.ApproveTime)}
 	orderRules := map[int]string{1: "ASC", 2: "DESC"}
 	ormList := make([]*report_approve.ReportApproveItemOrm, 0)
 
@@ -263,7 +264,12 @@ func (this *ReportApproveController) List() {
 			}
 			st := fmt.Sprintf("%s %s", params.StartTime, "00:00:00")
 			ed := fmt.Sprintf("%s %s", params.EndTime, "23:59:59")
-			cond += fmt.Sprintf(` AND (%s BETWEEN ? AND ?)`, timeField[params.TimeType])
+			field := mineTimeField[params.TimeType]
+			if field == "" {
+				br.Msg = "筛选时间有误"
+				return
+			}
+			cond += fmt.Sprintf(` AND (%s BETWEEN ? AND ?)`, field)
 			pars = append(pars, st, ed)
 		}
 		params.Keyword = strings.TrimSpace(params.Keyword)

+ 1 - 0
services/report_approve.go

@@ -738,6 +738,7 @@ func BuildNextNodeRecordAndMsg(approveNodeItem *report_approve.ReportApproveNode
 	})
 	for _, u := range approveNode.Users {
 		r := new(report_approve.ReportApproveRecord)
+		r.ReportApproveId = approveId
 		r.State = report_approve.ReportApproveStateApproving
 		r.NodeId = approveNode.ReportApproveNodeId
 		r.PrevNodeId = approveNode.PrevNodeId