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 {