belongsTo(User::class); } /** * 提现到余额的明细 * * @param [type] $query */ public function scopeOnlyWithdrawBalance($query) { return $query->where('action', '=', self::ACTION_WITHDRAW_BALACNE); } /** * 获取变动金额 * * @return string */ public function getChangeBalanceFormatAttribute() { return trim_trailing_zeros(bcdiv($this->attributes['change_balance'], 100, 2)); } }