This commit is contained in:
1099438829 2021-04-06 16:59:53 +08:00
parent 756c7a62a3
commit 260099bac3
1 changed files with 24 additions and 0 deletions

View File

@ -84,6 +84,30 @@ function get_document_category($x,$field=false){
} }
} }
/**
* @param $cid int 栏目分类
* @param bool $field
* @return mixed|string
* @throws Exception
* @author 李玉坤
* @date 2021-04-06 9:43
*/
function get_document_category_children($cid,$field=false){
if(!$cid){
throw new Exception('请指定要获取的栏目分类id');
}
$docuemtCategoryChildrendLidst = Db::name('document_category')->where('id','=',$cid)->column();
if(!$docuemtCategory){
throw new Exception('分类不存在或已删除!');
}
if($field){
return $docuemtCategory[$field];
}
else{
return $docuemtCategory;
}
}
/** /**
* 获取一个文章分类-通个分类标识 * 获取一个文章分类-通个分类标识
*/ */