Files
lotteryLaravel/app/Models/PlayerWallet.php

37 lines
742 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* 彩票侧余额(表 player_wallets按 player + wallet_type + currency 唯一。
*/
class PlayerWallet extends Model
{
protected $fillable = [
'player_id',
'wallet_type',
'currency_code',
'balance',
'frozen_balance',
'status',
'version',
];
protected function casts(): array
{
return [
'balance' => 'integer',
'frozen_balance' => 'integer',
'version' => 'integer',
];
}
public function player(): BelongsTo
{
return $this->belongsTo(Player::class);
}
}