mirror of
https://github.com/henry4682/finance_app.git
synced 2026-07-16 08:20:00 +00:00
30 lines
571 B
PHP
30 lines
571 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class InvestmentTransaction extends Model
|
|
{
|
|
protected $fillable = [
|
|
'holding_id',
|
|
'action',
|
|
'shares',
|
|
'price',
|
|
'fee',
|
|
'tax',
|
|
'traded_at',
|
|
'note',
|
|
'amount', // 實際投入金額(基金用)
|
|
'nav', // 淨值(基金用)
|
|
];
|
|
|
|
protected $casts = [
|
|
'traded_at' => 'date',
|
|
];
|
|
|
|
public function holding()
|
|
{
|
|
return $this->belongsTo(InvestmentHolding::class, 'holding_id');
|
|
}
|
|
} |