<?php
namespace App\Helper;

use App\Models\AccountLog;

trait LogHelper
{
    /**
     * account log记录
     * @param $data
     * @return AccountLog
     * @throws \Exception
     */
    private function logAccount($fromType, $fromId, $fromName, $fromAmount,  $op, $toType, $toId, $toName, $toAmount,$transactionId='',$avatar='') {
        return AccountLog::create([
            'from_type'     => $fromType,
            'from_id'       => $fromId,
            'from_name'     => $fromName,
            'from_amount'   => $fromAmount,
            'op'            => $op,
            'to_type'       => $toType,
            'to_id'         => $toId,
            'to_name'       => $toName,
            'to_amount'     => $toAmount,
            'transaction_id'  => $transactionId,
            'avatar'        => $avatar,
        ]);
    }


}