后台,订单日志列表增加查询条件

This commit is contained in:
wolter 2024-08-09 16:40:21 +08:00
parent b0be00741f
commit 9a413afa51
2 changed files with 19 additions and 1 deletions

View File

@ -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
}

View File

@ -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)