From 000a751ba649628dcd974edc66189d2a3a27c590 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 4 Oct 2023 00:42:12 +0800 Subject: [PATCH] update --- app/admin/svc/svc_data_statisstics.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go index 85e6704..c66dfb2 100644 --- a/app/admin/svc/svc_data_statisstics.go +++ b/app/admin/svc/svc_data_statisstics.go @@ -647,7 +647,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD var filterOrdNo []string if req.StartDate != "" { var mm []*model.CentralKitchenForSchoolUserWithDay - err := db.Db.Where("date >= ?", req.StartDate).And("date <= ?", req.EndDate).GroupBy("ord_no").Find(&mm) + sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) + eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) + err := db.Db.Where("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")).GroupBy("ord_no").Find(&mm) if err != nil { logx.Error(err) println("<<<>>>>Error:::", err.Error()) @@ -852,7 +854,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD var filterOrdNo []string if req.StartDate != "" { var mm []*model.CentralKitchenForSchoolUserWithDay - err := db.Db.Where("date >= ?", req.StartDate).And("date <= ?", req.EndDate).GroupBy("ord_no").Find(&mm) + sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) + eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) + err := db.Db.Where("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")).GroupBy("ord_no").Find(&mm) if err != nil { logx.Error(err) println("<<<>>>>Error:::", err.Error()) @@ -1492,7 +1496,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD var filterOrdNo []string if req.StartDate != "" { var mm []*model.CentralKitchenForSchoolUserWithDay - err := db.Db.Where("date >= ?", req.StartDate).And("date <= ?", req.EndDate).GroupBy("ord_no").Find(&mm) + sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) + eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) + err := db.Db.Where("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")).GroupBy("ord_no").Find(&mm) if err != nil { logx.Error(err) println("<<<>>>>Error:::", err.Error())