37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Course\Course;
|
|
use App\Models\Server\EvaluateList;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PortraitRecord extends Model
|
|
{
|
|
protected $fillable = [];
|
|
protected $guarded = [];
|
|
|
|
public function recommendUser(){
|
|
return $this->belongsTo(User::class,'recommend_user_id','id')->withTrashed();
|
|
}
|
|
|
|
public function course(){
|
|
return $this->belongsTo(Course::class,'match_type_id','id')->withTrashed();
|
|
}
|
|
public function activity(){
|
|
return $this->belongsTo(CommunityActivity::class,'match_type_id','id')->withTrashed();
|
|
}
|
|
public function service(){
|
|
return $this->belongsTo(CommunityActivity::class,'match_type_id','id')->withTrashed();
|
|
}
|
|
public function shop(){
|
|
return $this->belongsTo(MerchantShop::class,'match_type_id','id')->withTrashed();
|
|
}
|
|
public function consult(){
|
|
return $this->belongsTo(Consultation::class,'match_type_id','id')->withTrashed();
|
|
}
|
|
public function evaluate(){
|
|
return $this->belongsTo(EvaluateList::class,'match_type_id','test_item_id')->select('id','name as title','test_item_id')->withTrashed();
|
|
}
|
|
}
|