clrghouz/app/Models/BBS/CUG.php

21 lines
309 B
PHP
Raw Normal View History

2023-08-10 02:17:01 +00:00
<?php
namespace App\Models\BBS;
use Illuminate\Database\Eloquent\Model;
class CUG extends Model
{
protected $table = 'cugs';
public function isMember(CUG $o)
{
while ($o)
{
if (! $this->parent_id OR $o->id == $this->parent_id)
return TRUE;
$o = $this::findOrFail($o->parent_id);
}
}
}