fix: stats

This commit is contained in:
Rogee
2025-05-06 18:43:07 +08:00
parent 3387fb6cff
commit 463df5d3a9
4 changed files with 19 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package admin
import (
"quyun/app/models"
"quyun/app/requests"
"quyun/providers/wepay"
"github.com/gofiber/fiber/v3"
)
@@ -13,7 +14,9 @@ type OrderListQuery struct {
}
// @provider
type orders struct{}
type orders struct {
wepay *wepay.Client
}
// List users
//
@@ -24,3 +27,15 @@ func (ctl *orders) List(ctx fiber.Ctx, pagination *requests.Pagination, query *O
cond := models.Orders.BuildConditionWithKey(query.OrderNumber, query.UserID)
return models.Orders.List(ctx.Context(), pagination, cond)
}
// Refund
// @Router /admin/orders/{id}/refund [post]
// @Bind id path
func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
order, err := models.Orders.GetByID(ctx.Context(), id)
if err != nil {
return err
}
return ctx.JSON(order)
}