love_php/app/Models/Server/CollageGroup.php

51 lines
1.2 KiB
PHP
Raw Normal View History

2026-04-02 09:20:51 +08:00
<?php
namespace App\Models\Server;
use App\Models\Consultation;
use App\Models\Course\Course;
use App\Models\MerchantShop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class CollageGroup extends Model
{
use SoftDeletes;
protected $fillable = [];
protected $guarded = [];
public function community()
{
return $this->hasOne(CommunityActivity::class, 'id', 'type_id')->withTrashed();
}
public function activity()
{
return $this->hasOne(CommunityActivity::class, 'id', 'type_id')->withTrashed();
}
public function service()
{
return $this->hasOne(CommunityActivity::class, 'id', 'type_id')->withTrashed();
}
public function shop()
{
return $this->hasOne(MerchantShop::class, 'id', 'type_id')->withTrashed();
}
public function course()
{
return $this->hasOne(Course::class, 'id', 'type_id')->withTrashed();
}
public function evaluate()
{
return $this->hasOne(MerchantEvaluate::class, 'id', 'type_id')->withTrashed();
}
public function consult()
{
return $this->hasOne(Consultation::class, 'id', 'type_id')->withTrashed();
}
}