From 4e07471033c17ef02d86c50091b76ab752d2147e Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 6 Mar 2024 20:42:55 +0800 Subject: [PATCH] update --- app/customer/hdl/hdl_demo.go | 18 ++++++++++++++---- app/customer/svc/svc_pay.go | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/customer/hdl/hdl_demo.go b/app/customer/hdl/hdl_demo.go index 42db11b..a99c829 100644 --- a/app/customer/hdl/hdl_demo.go +++ b/app/customer/hdl/hdl_demo.go @@ -159,7 +159,7 @@ func Demo(c *gin.Context) { wxSvc := jsapi.JsapiApiService{Client: client} var m []model.CentralKitchenForSchoolPackageOrd eg := db.Db - if err1 := eg.Where("state = 1 AND create_at >= '2024-02-16 00:00:00' AND create_at < '2024-02-16 23:59:59'").Desc("id").Find(&m); err1 != nil { + if err1 := eg.Where("state = 1 AND create_at >= '2024-02-16 00:00:00' AND create_at < '2024-02-16 23:59:59' and pay_at ='2024-03-06 17:40:47'").Desc("id").Find(&m); err1 != nil { e.OutErr(c, e.ERR, err1.Error()) return } @@ -184,8 +184,17 @@ func Demo(c *gin.Context) { ) if err != nil { fmt.Println(err) - e.OutErr(c, e.ERR, err.Error()) - return + continue + //result, _, err := wxSvc.QueryOrderByOutTradeNo(c, + // jsapi.QueryOrderByOutTradeNoRequest{ + // OutTradeNo: core.String(v.OutTradeNo), + // SpMchid: core.String(sysCfg[enum.WxSpMchId]), + // SubMchid: core.String("1663751886"), + // }, + //) + //fmt.Println(result) + //e.OutErr(c, e.ERR, err.Error()) + //return } successTime, err := utils.ConvertWechatTime(*result.SuccessTime) if err != nil { @@ -195,12 +204,13 @@ func Demo(c *gin.Context) { } v.PayAt = successTime centralKitchenForSchoolPackageOrd.Set(v.OutTradeNo) - _, err = centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(&v, "pay_at") + updateAck, err := centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(&v, "pay_at") if err != nil { fmt.Println(err) e.OutErr(c, e.ERR, err.Error()) return } + fmt.Println("updateack:::::", updateAck) } return _, err = svc.DealCentralKitchenForSchoolOrderCallBackForWx("141271708763327845", "4200002114202402240122111525", "SUCCESS", "") diff --git a/app/customer/svc/svc_pay.go b/app/customer/svc/svc_pay.go index 89c40b7..9ecae9f 100644 --- a/app/customer/svc/svc_pay.go +++ b/app/customer/svc/svc_pay.go @@ -128,6 +128,7 @@ func BuyPackageForAli(c *gin.Context, req md.BuyPackageReq) (outTradeNo, tradeNo PayWay: enum.PayWayForAli, CreateAt: now.Format("2006-01-02 15:04:05"), UpdateAt: now.Format("2006-01-02 15:04:05"), + PayAt: "", }) if err != nil { _ = session.Rollback() @@ -263,6 +264,7 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, total st PrepayId: *result.PrepayId, CreateAt: now.Format("2006-01-02 15:04:05"), UpdateAt: now.Format("2006-01-02 15:04:05"), + PayAt: "", }) if err != nil { _ = session.Rollback()