mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-13 05:23:44 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -10,12 +10,7 @@ package pay
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/pay"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,39 +21,19 @@ type cRefund struct{}
|
||||
|
||||
// List 查看交易退款列表
|
||||
func (c *cRefund) List(ctx context.Context, req *pay.RefundListReq) (res *pay.RefundListRes, err error) {
|
||||
var in payin.PayRefundListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.PayRefund().List(ctx, in)
|
||||
list, totalCount, err := service.PayRefund().List(ctx, &req.PayRefundListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(pay.RefundListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出交易退款列表
|
||||
func (c *cRefund) Export(ctx context.Context, req *pay.RefundExportReq) (res *pay.RefundExportRes, err error) {
|
||||
var in payin.PayRefundListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.PayRefund().Export(ctx, in)
|
||||
err = service.PayRefund().Export(ctx, &req.PayRefundListInp)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user