AgentInfo.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\SoftDeletes;
  4. use Slowlyo\OwlAdmin\Models\BaseModel as Model;
  5. /**
  6. * 代理商
  7. */
  8. class AgentInfo extends Model
  9. {
  10. use SoftDeletes;
  11. protected $table = 'agent_infos';
  12. /**
  13. * @Author FelixYin
  14. * @description 代理商所属会员
  15. */
  16. public function member()
  17. {
  18. return $this->belongsTo(MemberUser::class, 'user_id', 'id');
  19. }
  20. /**
  21. * @Author FelixYin
  22. * @description 代理商关联信息认证
  23. */
  24. public function info()
  25. {
  26. return $this->hasOne(AgentInfoRecord::class, 'id', 'info_record_id');
  27. }
  28. /**
  29. * @Author FelixYin
  30. * @description 代理商关联实名认证信息
  31. */
  32. public function realAuth()
  33. {
  34. return $this->hasOne(AgentRealAuthRecord::class, 'id', 'real_auth_record_id');
  35. }
  36. /**
  37. * @Author FelixYin
  38. * @description 代理商开通项目分类
  39. */
  40. public function cates()
  41. {
  42. return $this->hasMany(AgentProjectCate::class, 'agent_id', 'id');
  43. }
  44. /**
  45. * @Author FelixYin
  46. * @description 代理商开通服务项目
  47. */
  48. public function projects()
  49. {
  50. return $this->hasMany(AgentProject::class, 'id');
  51. }
  52. /**
  53. * @Author FelixYin
  54. * @description 代理商关联信息认证记录
  55. */
  56. public function infoRecords()
  57. {
  58. return $this->hasMany(AgentInfoRecord::class, 'agent_id', 'id');
  59. }
  60. /**
  61. * @Author FelixYin
  62. * @description 代理商关联实名认证记录
  63. */
  64. public function realAuthRecords()
  65. {
  66. return $this->hasMany(AgentRealAuthRecord::class, 'agent_id', 'id');
  67. }
  68. /**
  69. * @Author FelixYin
  70. * @description 代理商项目设置
  71. */
  72. public function projectConfig()
  73. {
  74. return $this->hasOne(AgentProjectConfig::class, 'agent_id', 'id');
  75. }
  76. }