新增退款待审核角标提醒

This commit is contained in:
yml2213
2026-08-28 23:10:07 +08:00
parent 41a5b49450
commit a9a9127076
8 changed files with 176 additions and 1 deletions
@@ -2,6 +2,8 @@ package order
import (
"context"
"hfb_sys/backend/internal/model"
)
// ListPendingRefund 查询所有待客服审核退款的订单。
@@ -26,3 +28,13 @@ func (r *Repository) ListPendingRefund(ctx context.Context) ([]OrderDTO, error)
}
return items, nil
}
// PendingRefundCount 返回待客服审核退款数量,用于后台导航角标。
func (r *Repository) PendingRefundCount(ctx context.Context) (int64, error) {
var count int64
err := r.db.WithContext(ctx).
Model(&model.RentalOrder{}).
Where("refund_status = ?", refundStatusPendingReview).
Count(&count).Error
return count, err
}