From 9a413afa51e28b5c9db7aa00ebf0490eca31f28b Mon Sep 17 00:00:00 2001 From: wolter Date: Fri, 9 Aug 2024 16:40:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0,=E8=AE=A2=E5=8D=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/http/entities/backend/order.go | 5 ++++- app/services/order.go | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/http/entities/backend/order.go b/app/http/entities/backend/order.go index b60f97e..64a479f 100644 --- a/app/http/entities/backend/order.go +++ b/app/http/entities/backend/order.go @@ -102,7 +102,10 @@ func (o *OrdersResponse) ResponseFromDb(db ordersmodel.OrdersBackendList) { } type OrderLogsListRequest struct { - OrderId int64 `json:"order_id" form:"order_id"` + Id int64 `json:"id" form:"id"` + OrderId int64 `json:"order_id" form:"order_id"` + AppId int64 `json:"app_id" form:"app_id"` + OutTradeNo string `json:"out_trade_no" form:"out_trade_no"` entities.PageRequest } diff --git a/app/services/order.go b/app/services/order.go index 59d53e4..777bbb2 100644 --- a/app/services/order.go +++ b/app/services/order.go @@ -60,6 +60,15 @@ func OrderRequestLogsList(req backend.OrderLogsListRequest) (requestLog []orderr if req.OrderId > 0 { conn = conn.And(builder.Eq{"orders.id": req.OrderId}) } + if req.Id > 0 { + conn = conn.And(builder.Eq{"order_request_log.id": req.Id}) + } + if req.AppId > 0 { + conn = conn.And(builder.Eq{"order_request_log.app_id": req.AppId}) + } + if req.OutTradeNo != "" { + conn = conn.And(builder.Like{"order_request_log.out_trade_no", req.OutTradeNo}) + } // 请求日志 orderLogList := make([]orderrequestlogmodel.OrderRequestLog, 0) total, err := requestRepo.OrderRequestLogBackendList(conn, req.PageRequest, &orderLogList) @@ -74,6 +83,9 @@ func OrderCallbackLogsList(req backend.OrderLogsListRequest) (callback []orderca if req.OrderId > 0 { conn = conn.And(builder.Eq{"order_id": req.OrderId}) } + if req.Id > 0 { + conn = conn.And(builder.Eq{"id": req.Id}) + } // 回调日志 callbackLogList := make([]ordercallbacklogmodel.OrderCallbackLog, 0) total, err := callbackRepo.OrderCallbackLogList(conn, req.PageRequest, &callbackLogList) @@ -90,6 +102,9 @@ func OrderThirdLogsList(req backend.OrderLogsListRequest) (thirdLod []orderthird if req.OrderId > 0 { conn = conn.And(builder.Eq{"order_id": req.OrderId}) } + if req.Id > 0 { + conn = conn.And(builder.Eq{"id": req.Id}) + } thirdLogList := make([]orderthirdpaylogmodel.OrderThirdPayLog, 0) total, err := thirdRepo.OrderThirdPayLogList(conn, req.PageRequest, &thirdLogList) code = handErr(err)