微调
This commit is contained in:
@@ -226,6 +226,7 @@ function getArticlesByPosition($postion)
|
||||
* @Date: 2021/12/1 13:28
|
||||
* @param $category_id
|
||||
* @param int $take
|
||||
* @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
function getResumesByCate($category_id, $take = 8)
|
||||
{
|
||||
@@ -236,3 +237,24 @@ function getResumesByCate($category_id, $take = 8)
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 获取所有下级
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date: 2022/8/19 17:24
|
||||
* @param $array
|
||||
* @param $categoryId
|
||||
* @return array
|
||||
*/
|
||||
function getAllChild($categories, $categoryId)
|
||||
{
|
||||
$arr = array();
|
||||
foreach ($categories as $category) {
|
||||
if ($category['parent_id'] == $categoryId) {
|
||||
$arr[] = $category['id'];
|
||||
$arr = array_merge($arr, getAllChild($categories, $category['id']));
|
||||
};
|
||||
};
|
||||
return $arr;
|
||||
}
|
||||
Reference in New Issue
Block a user