_getRedis($teamUuid); $teamDb = $this->readTeamDb($r, $teamUuid); if (empty($teamDb)) { $this->_rspErr(1, 'The team has been disbanded'); return; } $matchDb = $this->readCurrMatchTeam($r); $this->_rspData(array( 'team_info' => $teamDb )); } public function cancel() { $teamUuid = getReqVal('team_uuid', ''); $r = $this->_getRedis($teamUuid); $teamDb = $this->readTeamDb($r, $teamUuid); if (!empty($teamDb)) { } $this->_rspOk(); } private function readTeamDb($r, $teamUuid) { $teamDbStr = $r->get(TEAMID_KEY . $teamUuid); if (empty($teamDbStr)) { return null; } $r->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600); $teamDb = json_decode($teamDbStr, true); return $teamDb; } /* { "current_team": "dafsdf" "match_time": 231434 } */ private function readCurrMatchTeam($r) { $teamDbStr = $r->get(MATCH_CURRENT_TEAM_KEY); if (empty($teamDbStr)) { return null; } $teamDb = json_decode($teamDbStr, true); return $teamDb; } /* { "target_team": "dafsdf" "match_time": 231434 } */ private function readMatchOk($r, $teamUuid) { $teamDbStr = $r->get(MATCH_OK_KEY . $teamUuid); if (empty($teamDbStr)) { return null; } $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); $teamDb = json_decode($teamDbStr, true); return $teamDb; } private function refreshKeyExpire($r, $key, $time) { $r->pexpire($key, $time); } }