6
0
Fork 0
jiqu-library-server/app/Models/WalletLog.php

35 lines
627 B
PHP

<?php
namespace App\Models;
use App\Helpers\Numeric;
use Illuminate\Database\Eloquent\Model;
class WalletLog 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 Numeric::trimTrailingZero(bcdiv($this->attributes['change_balance'], 100, 2));
}
}