|
|
@ -69,6 +69,17 @@ class Category extends BaseModel |
|
|
|
return $this->getTreeData($list); |
|
|
|
return $this->getTreeData($list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getChildrenList(array $param = []): array |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$list = $this->getAll($param)->toArray(); |
|
|
|
|
|
|
|
foreach ($list as &$item) { |
|
|
|
|
|
|
|
$item['children'] = $this->getAll( |
|
|
|
|
|
|
|
[ 'category_id' =>$item['category_id']], |
|
|
|
|
|
|
|
)->toArray(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $list; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取所有记录 |
|
|
|
* 获取所有记录 |
|
|
|
* @param array $param |
|
|
|
* @param array $param |
|
|
|