DtoService.php 528 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Module\Fund\Services;
  3. use App\Module\Fund\Dto\TransferDto;
  4. use App\Module\Fund\Logic\User;
  5. /**
  6. * Class Task
  7. *
  8. * @package App\Logic\Fund
  9. */
  10. class DtoService
  11. {
  12. /**
  13. * 使用TransferDto转账对象进行处理
  14. *
  15. * @param TransferDto $tr
  16. * @return bool|string
  17. */
  18. static public function transfer_call(TransferDto $tr)
  19. {
  20. $fund = new FundService($tr->fromUserId, $tr->fundId);
  21. return $fund->transfer($tr->toUserId, $tr->amount, $tr->remark);
  22. }
  23. }