This commit is contained in:
2026-09-15 16:02:45 +08:00
parent 112c5f8e46
commit ade2453083
70 changed files with 1441 additions and 707 deletions
+10 -2
View File
@@ -119,10 +119,18 @@ func (d *OutfitShareReceiverDao) OutfitShareReceivedList(ctx context.Context, re
Joins("JOIN outfit_share_receivers r ON r.share_uuid = outfit_shares.share_uuid").
Joins("JOIN outfits o ON o.id = outfit_shares.outfit_id").
Where("r.receiver_user_id = ?", receiverUserID).
Where("outfit_shares.status = ?", 1).
Where("o.is_public = ? AND o.audit_status = ? AND o.status = ? AND o.deleted_at = 0", 2, 2, 1)
// 可见性:仅排除「已删除」与「已封禁」的穿搭。
// 分享与公开状态解耦(仅自己可见的穿搭同样可分享),故不再按 is_public / audit_status 过滤;
// 穿搭删除或封禁后不再下发内容。
Where("o.status <> ? AND o.deleted_at = 0", 2)
if status != 0 {
// 显式筛选分享状态:1=正常 2=已取消。
// 修复:此前这里无条件叠加 `outfit_shares.status = 1`,与下面的参数条件形成
// `status = 1 AND status = 2`,导致传 status=2 恒返回空列表。
q = q.Where("outfit_shares.status = ?", status)
} else {
// 默认只返回正常分享:已取消的分享不应再出现在接收列表(保留「取消分享后不再下发」语义)。
q = q.Where("outfit_shares.status = ?", 1)
}
if err := q.Count(&total).Error; err != nil {
span.RecordError(err)