Merge pull request 'feature/user-section' (#33) from feature/user-section into main
Reviewed-on: https://git.softuniq.eu/Telegram-Market/telegram-shop/pulls/33
This commit is contained in:
commit
275a6ab493
@ -35,6 +35,7 @@ export default class UserHandler {
|
|||||||
const userId = msg.from.id;
|
const userId = msg.from.id;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
await User.recalculateBalance(userId);
|
||||||
const userStats = await User.getUserStats(userId);
|
const userStats = await User.getUserStats(userId);
|
||||||
|
|
||||||
if (!userStats) {
|
if (!userStats) {
|
||||||
@ -56,7 +57,8 @@ export default class UserHandler {
|
|||||||
├ Total Purchases: ${userStats.purchase_count || 0}
|
├ Total Purchases: ${userStats.purchase_count || 0}
|
||||||
├ Total Spent: $${userStats.total_spent || 0}
|
├ Total Spent: $${userStats.total_spent || 0}
|
||||||
├ Active Wallets: ${userStats.crypto_wallet_count || 0}
|
├ Active Wallets: ${userStats.crypto_wallet_count || 0}
|
||||||
└ Total Balance: $${userStats.total_balance || 0}
|
├ Bonus Balance: $${userStats.bonus_balance || 0}
|
||||||
|
└ Total Balance: $${(userStats.total_balance || 0) + (userStats.bonus_balance || 0)}
|
||||||
|
|
||||||
📅 Member since: ${new Date(userStats.created_at).toLocaleDateString()}
|
📅 Member since: ${new Date(userStats.created_at).toLocaleDateString()}
|
||||||
`;
|
`;
|
||||||
|
Loading…
Reference in New Issue
Block a user