From b61b1f511150528cde77104d6088ad715db77767 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 27 Feb 2024 11:33:42 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_demo.go | 2 +- .../svc_central_kitchen_for_school.go | 26 +++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/admin/hdl/hdl_demo.go b/app/admin/hdl/hdl_demo.go index 15f58ce..9d5d4c5 100644 --- a/app/admin/hdl/hdl_demo.go +++ b/app/admin/hdl/hdl_demo.go @@ -83,7 +83,7 @@ func DemoV1(c *gin.Context) { for _, v := range m { if recordsId[v.RecordsId] { repeatIds = append(repeatIds, v.Id) - centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayDelete(v.Id) + //centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayDelete(v.Id) } recordsId[v.RecordsId] = true } 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 8102be0..280e756 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 @@ -664,7 +664,17 @@ func CentralKitchenForSchoolOrdList(req md.CentralKitchenForSchoolOrdListReq) (r sess.And("user_identity.name like ?", "%"+req.Name+"%") } if req.Phone != "" { - sess.And("user.phone like ?", "%"+req.Phone+"%") + userDb := db.UserDb{} + userDb.Set() + user, err1 := userDb.GetUserByPhone(req.Phone) + if err1 != nil { + return nil, 0, err1 + } + if user != nil { + sess.And("central_kitchen_for_school_package_ord.uid = ?", user.Id) + } else { + sess.And("user.phone like ?", "%"+req.Phone+"%") + } } if req.EnterPriseKind != 0 { @@ -1000,7 +1010,19 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis sess.And("user_identity.name like ?", "%"+req.Name+"%") } if req.Phone != "" { - sess.And("user.phone like ?", "%"+req.Phone+"%") + if req.Phone != "" { + userDb := db.UserDb{} + userDb.Set() + user, err1 := userDb.GetUserByPhone(req.Phone) + if err1 != nil { + return nil, 0, err1 + } + if user != nil { + sess.And("central_kitchen_for_school_package_ord.uid = ?", user.Id) + } else { + sess.And("user.phone like ?", "%"+req.Phone+"%") + } + } } if len(classWithUserIdentityIdsOne) > 0 {