From 12056eb4925df078b6072b643a01af2a2c518d31 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 15 Jan 2024 18:27:42 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_audit_center.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/admin/hdl/hdl_audit_center.go b/app/admin/hdl/hdl_audit_center.go index 62a97b6..4600bec 100644 --- a/app/admin/hdl/hdl_audit_center.go +++ b/app/admin/hdl/hdl_audit_center.go @@ -128,6 +128,7 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { centralKitchenForSchoolUserRefundDayDb.Set(0) centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} centralKitchenForSchoolUserWithDayDb.Set(0) + var recordsId = map[int]bool{} for _, v := range req.Ids { returnDay, err1 := centralKitchenForSchoolUserRefundDayDb.GetCentralKitchenForSchoolUserRefundDay(utils.StrToInt(v)) if err1 != nil { @@ -139,6 +140,12 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { e.OutErr(c, e.ERR, "请勿重复审核申请单!") return } + if recordsId[returnDay.RecordsId] { + _ = session.Rollback() + e.OutErr(c, e.ERR, "当前含有重复退订餐记录!") + return + } + recordsId[returnDay.RecordsId] = true //1、更新状态 if req.State == 1 {