小调整
This commit is contained in:
@@ -74,4 +74,15 @@ class Category extends Model
|
||||
return $ids;
|
||||
}
|
||||
|
||||
public function getTop()
|
||||
{
|
||||
$parent = $this;
|
||||
|
||||
while ($parent->parent_id) {
|
||||
$parent->parent;
|
||||
}
|
||||
|
||||
return $parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user