public function listAction() { if (!MyTool::loginAuth($this)) { return MyTool::onExit($this, MyConst::STATUS_NOT_LOGIN, 'must login first'); } $uid = @intval(MyTool::getCookie($this, MyConst::COOKIE_UID)); $memberOf = TeamLogic::memberOf($uid); if (is_array($memberOf) && !empty($memberOf)) { $tids = ""; for ($i = 0; $i < count($memberOf); $i++) { $tids .= ',' . $memberOf->id; } $teams = TeamLogic::getTeams($tids); if (is_array($teams) && !empty($teams)) { $myTeams = array_merge($myTeams, $teams); } } if (empty($myTeams)) { return MyTool::onExit($this, MyConst::STATUS_ERROR, 'no teams'); } MyTool::setVar($this, MyConst::FIELD_STATUS, MyConst::STATUS_OK); MyTool::setVar($this, MyConst::FIELD_USER, $myTeams); return true; }