LogHelper.php 847 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Helper;
  3. use App\Models\AccountLog;
  4. trait LogHelper
  5. {
  6. /**
  7. * account log记录
  8. * @param $data
  9. * @return AccountLog
  10. * @throws \Exception
  11. */
  12. private function logAccount($fromType, $fromId, $fromName, $fromAmount, $op, $toType, $toId, $toName, $toAmount,$transactionId='',$avatar='') {
  13. return AccountLog::create([
  14. 'from_type' => $fromType,
  15. 'from_id' => $fromId,
  16. 'from_name' => $fromName,
  17. 'from_amount' => $fromAmount,
  18. 'op' => $op,
  19. 'to_type' => $toType,
  20. 'to_id' => $toId,
  21. 'to_name' => $toName,
  22. 'to_amount' => $toAmount,
  23. 'transaction_id' => $transactionId,
  24. 'avatar' => $avatar,
  25. ]);
  26. }
  27. }