FundAdminModel.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 int $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. protected $fillable = [
  35. 'admin_id',
  36. 'admin_name',
  37. 'fund_id',
  38. 'type',
  39. 'status',
  40. 'remark',
  41. 'create_time',
  42. 'create_ip',
  43. 'update_time',
  44. 'update_ip'
  45. ];
  46. public $timestamps = false;
  47. protected $casts = [
  48. 'fund_id' => FUND_TYPE::class,
  49. ];
  50. /**
  51. * 获取管理员信息
  52. */
  53. public function admin()
  54. {
  55. return $this->belongsTo('Dcat\Admin\Models\Administrator', 'admin_id');
  56. }
  57. /**
  58. * 获取资金账户
  59. */
  60. public function fund()
  61. {
  62. return $this->belongsTo('App\Module\Fund\Models\FundModel', 'fund_id');
  63. }
  64. }