/**
* 递规获取某个分类下的所有子级
* @param type $parentid 分类id
*/
public $son_id=array();
public function getIds($parentid){
$list=Db::name("GoodsCategory")->where(["parent_id"=>$parentid])->select();
foreach ($list as $key => $value) {
$this->son_id[]=$value['id'];
$this->getIds($value['id']);
}
return $this->son_id;
}转载请注明本文标题和链接:《 thinkphp5无限级分类递规获取子类ID 》



网友评论 0