where(["id" => $id])->find(); if ($result == null) { return $id; } $info = $result->toArray(); if ($info['pid']==1) { return $id; } return $this->getTopGroup($info['pid']); } catch (Exception $e) { return $id; } } }