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(MemberUser::class, 'user_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联信息认证
- */
- public function info()
- {
- return $this->hasOne(AgentInfoRecord::class, 'id', 'info_record_id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联实名认证信息
- */
- public function realAuth()
- {
- return $this->hasOne(AgentRealAuthRecord::class, 'id', 'real_auth_record_id');
- }
- /**
- * @Author FelixYin
- * @description 代理商开通项目分类
- */
- public function cates()
- {
- return $this->hasMany(AgentProjectCate::class, 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商开通服务项目
- */
- public function projects()
- {
- return $this->hasMany(AgentProject::class, 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联信息认证记录
- */
- public function infoRecords()
- {
- return $this->hasMany(AgentInfoRecord::class, 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商关联实名认证记录
- */
- public function realAuthRecords()
- {
- return $this->hasMany(AgentRealAuthRecord::class, 'agent_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 代理商项目设置
- */
- public function projectConfig()
- {
- return $this->hasOne(AgentProjectConfig::class, 'agent_id', 'id');
- }
- }
|