protected function getData($field, $order, $limit, $offset) { Wind::import('SRV:forum.vo.PwThreadSo'); $so = new PwThreadSo(); $time = Pw::getTime(); $so->setDisabled(0); $field['tids'] && $so->setTid(explode(' ', $field['tids'])); if ($field['usernames']) { $usernames = explode(' ', $field['usernames']); foreach ($usernames as &$username) { $username = trim($username); } $users = Wekit::load('user.PwUser')->fetchUserByName($usernames); $uids = array_keys($users); if ($uids) { $so->setAuthorId($uids); } else { return array(); } } $field['keywords'] && $so->setKeywordOfTitle(trim($field['keywords'])); $field['mapFid'] && $so->setFid($field['mapFid']); //修正后的fids $field['special'] && $so->setSpecial($field['special']); $field['istop'] && $so->setTopped($field['istop']); $field['ispic'] && $so->setHasImage($field['ispic']); //$field['isattach'] && $so->setIsattach($field['isattach']); $field['isdigest'] && $so->setDigest($field['isdigest']); $field['createdtime'] && $so->setCreateTimeStart($time - intval($field['createdtime'])); $field['createdtime'] && $so->setCreateTimeEnd($time); $field['posttime'] && $so->setLastpostTimeStart($time - intval($field['posttime'])); $field['posttime'] && $so->setLastpostTimeEnd($time); switch ($order) { case '2': $so->orderbyLastPostTime(false); break; case '1': $so->orderbyCreatedTime(false); break; case '3': $so->orderbyReplies(false); break; case '4': $so->orderbyHits(false); break; case '5': $so->orderbyLike(false); break; } $list = Wekit::load('forum.PwThread')->searchThread($so, $limit, $offset); return $this->_buildSignKey($list, $field['ishighlight']); }