From 0b7fd0de864afe226229b5caace81360445caeef Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 17 Oct 2023 14:00:25 +0800 Subject: [PATCH] update --- .../svc/enterprise_manage/svc_central_kitchen_for_school.go | 2 +- app/db/db_central_kitchen_for_school_user_with_day.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go index 4e7174a..6d8b0b2 100644 --- a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go @@ -852,7 +852,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis if count2 > 0 { state = 3 stateZh = "部分退款" - count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDay(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) + count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDay(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) if err1 != nil { return nil, 0, err3 } diff --git a/app/db/db_central_kitchen_for_school_user_with_day.go b/app/db/db_central_kitchen_for_school_user_with_day.go index 214db75..3e165c8 100644 --- a/app/db/db_central_kitchen_for_school_user_with_day.go +++ b/app/db/db_central_kitchen_for_school_user_with_day.go @@ -97,9 +97,11 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb return count, nil } -func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDay(ordNo string, kind int) (count int64, err error) { +func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDay(ordNo, startDate, endDate string, kind int) (count int64, err error) { var m model.CentralKitchenForSchoolUserWithDay - count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("kind =?", kind).Count(&m) + count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo). + And("date >= ?", startDate).And("date <= ?", endDate). + And("kind =?", kind).Count(&m) return count, nil }