public function getCaseListFirstBySpaceId($spaceId) {/*{{{*/ $space = DAL::get()->find('space', $spaceId); if($space->isNull()) { $this->setErrorCode(328); return 0; } $fetchCount = self::CASE_COUNT_DEF; $type = Serivce::TYPE_FLOW; $options = array('nowPage'=>0, 'pageSize'=>$fetchCount); $newThreads = DAL::get()->find_all_spaceNotProcessList('proposal', $space, $type, $options); $oldThreads = flowClient::getInstance()->getOldThreadList($spaceId, $fetchCount); $infos1 = $this->_getCaseListBackInfos($newThreads); $infos2 = $this->_getCaseListBackInfos($oldThreads); $infos = array_merge($infos1,$infos2); $this->content = $infos; }/*}}}*/
private function getNextCasePostListBySpaceIdAndLastPostTime($userId, $lastPostTime, $type, $tabType, $id) {/*{{{*/ $space = DAL::get()->find('space', $userId); if($space->isNull()) { $this->setErrorCode(328); return 0; } $fetchCount = 1; $threads = array(); if('thread' == $type) { if($tabType == self::TABTYPE_NEW) { $maxCnt = 1000; $threads = DAL::get()->find_all_byUtime('proposal', $space->id, $maxCnt, ''); if(false == empty($threads)) { if(count($threads) == 1) //1条咨询不循环 { $threads = array(); } else { $ids = array_keys($threads); $threadList = array_values($threads); $key = array_search($id, $ids); if(isset($threadList[$key+1])) { $thread = $threadList[$key+1]; } else if(isset($threadList[0])) { $thread = $threadList[0]; } else { $thread = ''; } if($thread) { $threads = array($thread->id=>$thread); } } } } else { $threads = DAL::get()->find_all_lastUnReadProposal4Space('proposal', $space, ServiceDef::TYPE_FLOW, array('nowPage' => 0, 'pageSize' => 1)); if(empty($threads)) { $res = flowClient::getInstance()->getOldThreadList($userId, 0, '', '', '', 1, true); $threads = isset($res['list']) ? $res['list'] : array(); } } } else if('flow' == $type) { $res = flowClient::getInstance()->getOldThreadList($userId, 0, '', '', '', 1, true); $threads = isset($res['list']) ? $res['list'] : array(); } return $threads; }/*}}}*/