fix(order): 支持客服跨站处理订单与退款

This commit is contained in:
yml
2026-11-19 20:29:16 +08:00
parent 3492ecbe9b
commit cd081d1cdd
18 changed files with 349 additions and 191 deletions
@@ -7,7 +7,7 @@ import (
// ListPendingRefund 查询所有待客服审核退款的订单。
func (r *Repository) ListPendingRefund(ctx context.Context) ([]OrderDTO, error) {
var rows []orderRow
err := applyBuyerTenantOrderScope(r.adminQuery(ctx), ctx).
err := applyTenantOrderScope(r.adminQuery(ctx), ctx).
Where("o.refund_status = ?", refundStatusPendingReview).
Order("o.updated_at ASC, o.id ASC").
Limit(200).
@@ -34,7 +34,7 @@ func (r *Repository) PendingRefundCount(ctx context.Context) (int64, error) {
query := r.db.WithContext(ctx).
Table("rental_orders AS o").
Where("refund_status = ?", refundStatusPendingReview)
query = applyBuyerTenantOrderScope(query, ctx)
query = applyTenantOrderScope(query, ctx)
err := query.Count(&count).Error
return count, err
}