From 38edc9f324d3eab80fe023db11ec0038a5c49d80 Mon Sep 17 00:00:00 2001 From: Zuncle <34310384@qq.com> Date: Thu, 2 Apr 2026 23:35:18 +0800 Subject: [PATCH] fix(user): align profile inventory stats with held assets Count only status=1 inventory in the admin user profile so the profile inventory metrics match the held-assets inventory list semantics. --- internal/api/admin/users_profile.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/api/admin/users_profile.go b/internal/api/admin/users_profile.go index 5525a51..e0c8366 100755 --- a/internal/api/admin/users_profile.go +++ b/internal/api/admin/users_profile.go @@ -207,9 +207,7 @@ func (h *handler) GetUserProfile() core.HandlerFunc { LEFT JOIN orders o ON o.id = ui.order_id LEFT JOIN user_item_cards uic ON uic.id = o.item_card_id LEFT JOIN system_item_cards sic ON sic.id = uic.card_id - WHERE ui.user_id = ? AND ui.status IN (1, 3) - AND COALESCE(ui.remark, '') NOT LIKE '%%void%%' - AND NOT (ui.status = 3 AND (COALESCE(ui.remark, '') LIKE '%%redeemed_points%%' OR COALESCE(ui.remark, '') LIKE '%%batch_redeemed%%')) + WHERE ui.user_id = ? AND ui.status = 1 `, userID).Scan(&is).Error rsp.CurrentAssets.InventoryCount = is.Count rsp.CurrentAssets.InventoryValue = is.Value