Compare commits

...

2 Commits

Author SHA1 Message Date
hailin 20eabbb85f fix(mining-admin): restore MINING_ENABLED status filter for adoption stats
Revert the previous change that removed the status filter. The stats
should only count adoptions with MINING_ENABLED status, as only those
are active for mining. The issue is likely that the status field in
synced_adoptions table doesn't have the correct value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 01:32:39 -08:00
hailin 65bd4f9b65 fix(mining-admin): remove MINING_ENABLED status filter for adoption stats
The adoption stats were showing 0 because the synced_adoptions table
contains status values directly from 1.0 system (PAID, POOL_INJECTED, etc.)
rather than MINING_ENABLED. Since contribution-service doesn't update the
status after calculating contributions, we now count all synced adoptions.

Changes:
- Remove status filter in getAdoptionStatsForUsers
- Remove status filter in getUserDetail adoption queries
- Remove status filter in getUserAdoptionStats for referral tree
- Add order count display in user detail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 01:21:01 -08:00
1 changed files with 16 additions and 2 deletions

View File

@ -145,13 +145,27 @@ export default function UserDetailPage() {
<p className="text-sm text-muted-foreground flex items-center gap-1">
<TreePine className="h-3 w-3 text-green-600" />
</p>
<p className="text-lg font-bold text-green-600">{formatNumber(user?.personalAdoptions ?? 0)}</p>
<p className="text-lg font-bold text-green-600">
{formatNumber(user?.personalAdoptions ?? 0)}
{(user?.personalAdoptionOrders ?? 0) > 0 && (
<span className="text-sm font-normal text-green-500 ml-1">
({user?.personalAdoptionOrders})
</span>
)}
</p>
</div>
<div className="p-3 bg-blue-50 dark:bg-blue-950 rounded-lg">
<p className="text-sm text-muted-foreground flex items-center gap-1">
<Users className="h-3 w-3 text-blue-600" />
</p>
<p className="text-lg font-bold text-blue-600">{formatNumber(user?.teamAdoptions ?? 0)}</p>
<p className="text-lg font-bold text-blue-600">
{formatNumber(user?.teamAdoptions ?? 0)}
{(user?.teamAdoptionOrders ?? 0) > 0 && (
<span className="text-sm font-normal text-blue-500 ml-1">
({user?.teamAdoptionOrders})
</span>
)}
</p>
</div>
<div className="p-3 bg-purple-50 dark:bg-purple-950 rounded-lg">
<p className="text-sm text-muted-foreground"></p>