You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
737 B
Go

package manage
import (
"github.com/gin-gonic/gin"
"gold-shop/errors"
request "gold-shop/request/manage"
"gold-shop/service"
"gold-shop/utils/excel"
"gold-shop/utils/result"
)
func GetPayments(c *gin.Context) (result.Data, error) {
var req request.PaymentQueryRequest
err := c.ShouldBindQuery(&req)
if err != nil {
return nil, errors.NewBusinessError("参数错误")
}
records, total := service.PaymentService.GetPayments(req)
data := result.Data{
"records": records,
"total": total,
}
return data, nil
}
func DownloadPayments(c *gin.Context) {
var req request.PaymentQueryRequest
_ = c.ShouldBindQuery(&req)
f := service.PaymentService.GeneratePaymentsExcel(req)
excel.Download(f, "支付列表.xlsx", c)
}