diff --git a/src/handlers/userHandlers/userHandler.js b/src/handlers/userHandlers/userHandler.js index ebe8f9c..d862aae 100644 --- a/src/handlers/userHandlers/userHandler.js +++ b/src/handlers/userHandlers/userHandler.js @@ -54,6 +54,7 @@ export default class UserHandler { ├ Total Purchases: ${userStats.purchase_count || 0} ├ Total Spent: $${userStats.total_spent || 0} ├ Active Wallets: ${userStats.crypto_wallet_count || 0} +├ Archived Wallets: ${userStats.archived_wallet_count || 0} ├ Bonus Balance: $${userStats.bonus_balance || 0} └ Total Balance: $${(userStats.total_balance || 0) + (userStats.bonus_balance || 0)} diff --git a/src/services/userService.js b/src/services/userService.js index 3e12c09..d4307c5 100644 --- a/src/services/userService.js +++ b/src/services/userService.js @@ -37,8 +37,8 @@ class UserService { COUNT(DISTINCT cw2.id) as archived_wallet_count FROM users u LEFT JOIN purchases p ON u.id = p.user_id - LEFT JOIN crypto_wallets cw ON u.id = cw.user_id AND cw.wallet_type NOT LIKE '%_%' - LEFT JOIN crypto_wallets cw2 ON u.id = cw2.user_id AND cw2.wallet_type LIKE '%_%' + LEFT JOIN crypto_wallets cw ON u.id = cw.user_id AND cw.wallet_type NOT LIKE '%#_%' ESCAPE '#' + LEFT JOIN crypto_wallets cw2 ON u.id = cw2.user_id AND cw2.wallet_type LIKE '%#_%' ESCAPE '#' WHERE u.telegram_id = ? GROUP BY u.id `, [telegramId.toString()]);