39 lines
743 B
PHP
39 lines
743 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class WalletTransaction extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
public $timestamps = false;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'member_id',
|
||
|
|
'type',
|
||
|
|
'amount',
|
||
|
|
'balance_after',
|
||
|
|
'description',
|
||
|
|
'reference_type',
|
||
|
|
'reference_id',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'amount' => 'decimal:2',
|
||
|
|
'balance_after' => 'decimal:2',
|
||
|
|
'created_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 所屬會員
|
||
|
|
*/
|
||
|
|
public function member(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Member::class);
|
||
|
|
}
|
||
|
|
}
|