34 lines
597 B
PHP
34 lines
597 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BalanceLog extends Model
|
|
{
|
|
public const ACTION_ORDER_PAY = 1;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'loggable_id',
|
|
'loggable_type',
|
|
'action',
|
|
'before_balance',
|
|
'change_balance',
|
|
'remarks',
|
|
];
|
|
|
|
/**
|
|
* 获取变动金额
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getChangeBalanceFormatAttribute()
|
|
{
|
|
return trim_trailing_zeros(bcdiv($this->attributes['change_balance'], 100, 2));
|
|
}
|
|
}
|