FundAdminModel.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Module\Fund\Models;
  3. use App\Module\Fund\Enums\FUND_TYPE;
  4. use UCore\ModelCore;
  5. /**
  6. * 资金管理员
  7. *
  8. * field start
  9. * @property int $id 自增
  10. * @property int $total_fee 钱数
  11. * @property int $status
  12. * @property \App\Module\Fund\Enums\FUND_TYPE $fund_id id
  13. * @property int $user_id 这个订单的用户
  14. * @property int $admin_id 管理员的id
  15. * @property int $create_time 创建时间
  16. * @property string $remark 备注
  17. * field end
  18. */
  19. class FundAdminModel extends ModelCore
  20. {
  21. protected $table = 'fund_admin';
  22. // attrlist start
  23. protected $fillable = [
  24. 'id',
  25. 'total_fee',
  26. 'status',
  27. 'fund_id',
  28. 'user_id',
  29. 'admin_id',
  30. 'create_time',
  31. 'remark',
  32. ];
  33. // attrlist end
  34. public $timestamps = false;
  35. protected $casts = [
  36. 'fund_id' => FUND_TYPE::class,
  37. ];
  38. /**
  39. * 获取管理员信息
  40. */
  41. public function admin()
  42. {
  43. return $this->belongsTo('Dcat\Admin\Models\Administrator', 'admin_id');
  44. }
  45. /**
  46. * 获取资金账户
  47. */
  48. public function fund()
  49. {
  50. return $this->belongsTo('App\Module\Fund\Models\FundModel', 'fund_id');
  51. }
  52. }