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)