12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Slowlyo\OwlAdmin\Models\BaseModel as Model;
- /**
- * 代理商
- */
- class AgentInfo extends Model
- {
- use SoftDeletes;
- protected $table = 'agent_infos';
- /**
- * @Author FelixYin
- * @description 代理商所属会员
- */
- public function member()
- {
- return $this->belongsTo('App\Models\MemberUser', 'user_id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联信息认证
- */
- public function info()
- {
- return $this->hasOne('App\Models\AgentInfoRecord', 'id', 'info_record_id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联实名认证信息
- */
- public function realAuth()
- {
- return $this->hasOne('App\Models\AgentRealAuthRecord', 'id', 'real_auth_record_id');
- }
- /**
- * @Author FelixYin
- * @description 代理商开通项目分类
- */
- public function cates()
- {
- return $this->hasMany('App\Models\AgentProjectCate', 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商开通服务项目
- */
- public function projects()
- {
- return $this->hasMany('App\Models\AgentProject', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联信息认证记录
- */
- public function infoRecords()
- {
- return $this->hasMany('App\Models\AgentInfoRecord', 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联实名认证记录
- */
- public function realAuthRecords()
- {
- return $this->hasMany('App\Models\AgentRealAuthRecord', 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商项目设置
- */
- public function projectConfig()
- {
- return $this->hasOne('App\Models\AgentProjectConfig', 'agent_id', 'id');
- }
- }
|