public static function parenttree($id,$n=0)
{
$positions_parent=newPosition::find()->where(['=','id',$id])->all();
foreach($positions_parent as $item)
{
$pos_info=newPosition::findOne($item->parent_id);
$data[$item->id]=self::parenttree($pos_info->id,$n+1);
}
return $data;
}
}