FundTransferModel.php 994 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Module\Fund\Models;
  3. use App\Models\ModelCore;
  4. use App\Module\User\Model\User;
  5. class FundTransferModel extends ModelCore
  6. {
  7. protected $table = 'fund_transfer';
  8. protected $fillable = [
  9. 'user_id',
  10. 'from_fund_id',
  11. 'to_fund_id',
  12. 'amount',
  13. 'status',
  14. 'remark',
  15. 'create_time',
  16. 'create_ip',
  17. 'update_time',
  18. 'update_ip',
  19. 'admin_id',
  20. 'admin_name'
  21. ];
  22. public $timestamps = false;
  23. /**
  24. * 获取用户信息
  25. */
  26. public function user()
  27. {
  28. return $this->belongsTo(User::class, 'user_id');
  29. }
  30. /**
  31. * 获取来源资金账户
  32. */
  33. public function fromFund()
  34. {
  35. return $this->belongsTo('App\Module\Fund\Models\FundModel', 'from_fund_id');
  36. }
  37. /**
  38. * 获取目标资金账户
  39. */
  40. public function toFund()
  41. {
  42. return $this->belongsTo('App\Module\Fund\Models\FundModel', 'to_fund_id');
  43. }
  44. }