From 8ce541517ed906e67c257f0011e67c448b6265a9 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 3 Jul 2024 15:08:27 +0800 Subject: [PATCH 1/2] update --- .../svc_central_kitchen_for_school.go | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 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 1adb72e..e0a5794 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 @@ -1189,22 +1189,22 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor // } //} - var months []time.Month - if req.StartDate != "" { - sDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local) - eDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local) - _, sMonth, _ := sDate.Date() - _, eMonth, _ := eDate.Date() - diffMonth := sMonth - eMonth - if diffMonth == 0 { - //TODO::查询一个月 - months = append(months, sMonth) - } else { - for i := sMonth; i <= eMonth; i++ { - months = append(months, i) - } - } - } + //var months []time.Month + //if req.StartDate != "" { + // sDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local) + // eDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local) + // _, sMonth, _ := sDate.Date() + // _, eMonth, _ := eDate.Date() + // diffMonth := sMonth - eMonth + // if diffMonth == 0 { + // //TODO::查询一个月 + // months = append(months, sMonth) + // } else { + // for i := sMonth; i <= eMonth; i++ { + // months = append(months, i) + // } + // } + //} sess := db.Db.Desc("central_kitchen_for_school_package_ord_for_reserve.id") admin := svc.GetUser(c) @@ -1237,6 +1237,10 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor if req.Name != "" { sess.And("user_identity.name like ?", "%"+req.Name+"%") } + if req.StartDate != "" { + sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate). + And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.StartDate) + } if req.Phone != "" { if req.Phone != "" { userDb := db.UserDb{} @@ -1262,9 +1266,9 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor //if len(centralKitchenForSchoolUserWithDayIds) > 0 { // sess.In("central_kitchen_for_school_package_ord.out_trade_no", centralKitchenForSchoolUserWithDayIds) //} - if len(months) > 0 { - sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) - } + //if len(months) > 0 { + // sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) + //} if req.EnterPriseKind != 0 { sess.And("enterprise.kind = ?", req.EnterPriseKind) } From 146b2d13eb8ff3fc3310158ffb59bf00be750f60 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 3 Jul 2024 15:54:14 +0800 Subject: [PATCH 2/2] update --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5cc7372..7ff3c86 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/go-redis/redis v6.15.9+incompatible github.com/go-sql-driver/mysql v1.7.1 github.com/gomodule/redigo v2.0.0+incompatible + github.com/jinzhu/copier v0.4.0 github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 github.com/mcuadros/go-defaults v1.2.0 github.com/medivhzhan/weapp/v2 v2.5.0 @@ -40,7 +41,6 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gookit/color v1.3.6 // indirect - github.com/jinzhu/copier v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kr/text v0.2.0 // indirect