根据标签获取当前登录用户该标签下的收藏列表

对应API：{@link http://open.weibo.com/wiki/2/favorites/by_tags favorites/by_tags}


@param int $tid  需要查询的标签ID。'
@param int $count 单页返回的记录条数，默认为50。
@param int $page 返回结果的页码，默认为1。
@return array
496326
function favorites_by_tags( $tid, $page = 1, $count = 50)
	{
		$params = array();
		$params['tid'] = $tid;
		$params['count'] = $count;
		$params['page'] = $page;
		return $this->oauth->get( 'favorites/by_tags', $params );
	}
929856
public function Lists($pagesize=10){
    	
    	//如启用mongodb则使用mongodb
    	if($this->mongodb){
    		$res = $this->mongodbLists($pagesize);
    		return $res;
    		exit(0);
    	}
    	 
    	//mysql
    	// 查询状态为1的用户数据 并且每页显示10条数据
    	$list = self::where('status',1)->paginate($pagesize);
    	// 获取分页显示
    	$page = $list->render();
    	 
    	$res['list'] = $list;
    	$res['page'] = $page;
    	return $res;
    }
1256026
public function getSql($count = false){
        if ($count){
            $select = 'count(*)';
        }else{
            $select = $this->voDatum->getSelect();
        }
        $sql = "select $select from $this->dbName ";
        $params = array();
        foreach ($this->joins as $k => $v){
            list($joinSql, $ps) = $v;
            $sql .= $joinSql;
            foreach ($ps as $p)
                $params[] = $p;
        }

        $where = $this->where->getString();
        if ($where)
            $sql .= ' where ' . $where;
        if (!$count)
            $sql .= $this->getOrder();
        if (is_numeric($this->limit))
            $sql .= " limit $this->limit ";
        if (is_numeric($this->offset))
            $sql .= " offset $this->offset ";

        foreach ($this->where->getParams() as $p)
            $params[] = $p;
        return array($sql, $params);
    }
266402
public function actionIndex($page = 1, $id = 0)
    {
        $searchModel = $this->module->model('UserSearch');
        $params = Yii::$app->request->queryParams;
        $dataProvider = $searchModel->search($params);

        $pager = $dataProvider->getPagination();
        $pager->pageSize = intval($this->module->params['pageSizeAdmin']);
        $pager->totalCount = $dataProvider->getTotalCount();

        // page number correction
        $maxPage = ceil($pager->totalCount / $pager->pageSize);
        if ($page > $maxPage) {
            $pager->page = $maxPage - 1;
        } else {
            $pager->page = $page - 1; //! from 0
        }

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'currentId'    => $id,
        ]);
    }
225329
private function getStatementSubtree($locationId, $count = false)
    {
        /**
         * @var \eZ\Publish\SPI\Persistence\Content\Location\Handler
         */
        $locationHandler = $this->getContainer()->get('ezpublish.spi.persistence.location_handler');
        $location = $locationHandler->load($locationId);
        $q = $this->connection->createQueryBuilder()
            ->select($count ? 'count(DISTINCT c.id)' : 'DISTINCT c.id')
            ->from('ezcontentobject', 'c')
            ->innerJoin('c', 'ezcontentobject_tree', 't', 't.contentobject_id = c.id')
            ->where('c.status = :status')
            ->andWhere('t.path_string LIKE :path')
            ->setParameter('status', ContentInfo::STATUS_PUBLISHED, PDO::PARAM_INT)
            ->setParameter('path', $location->pathString . '%', PDO::PARAM_STR);

        return $q->execute();
    }
347418
function followers_active( $uid,  $count = 20)
	{
		$param = array();
		$this->id_format($uid);
		$param['uid'] = $uid;
		$param['count'] = $count;
		return $this->oauth->get( 'friendships/followers/active', $param);
	}
15795
public function render($total_count=null)
    {
        if ($this->hasPages()) {
            if (!empty($total_count)) {
                if ($this->simple) {
                    return sprintf('<nav aria-label="Page navigation" class="text-center"><ul class="pagination"><li><i class="count">共'. ceil($total_count/config('manage_rows_num')) .'页，每页'. config('manage_rows_num') .'条数据</i></li>%s %s<li><i class="count">跳转到</i></li><li><form action="" class="search-form" method="get"><input type="text" class="go_page" value="'. input('page') .'" style="width:35px;"><input type="submit" name="page" class="go" value="GO" /></form></li></ul></nav>', $this->getPreviousButton(), $this->getNextButton());
                } else {
                    return sprintf('<nav aria-label="Page navigation" class="text-center"><ul class="pagination"><li><i class="count">共'. ceil($total_count/config('manage_rows_num')) .'页，每页'. config('manage_rows_num') .'条数据</i></li>%s %s %s<li><i class="count">跳转到</i></li><li><form action="" class="search-form" method="get"><input type="text" name="page" class="go_page" value="'. input('page') .'" style="width:35px;"><input type="submit" class="go" value="GO" /></form></li></ul></nav>', $this->getPreviousButton(), $this->getLinks(), $this->getNextButton());
                }
            } else {
                if ($this->simple) {
                    return sprintf('<nav aria-label="Page navigation" class="text-center"><ul class="pagination">%s %s %s</ul></nav>', $this->getPreviousButton(), $this->getNextButton());
                } else {
                    return sprintf('<nav aria-label="Page navigation" class="text-center"><ul class="pagination">%s %s %s</ul></nav>', $this->getPreviousButton(), $this->getLinks(), $this->getNextButton());
                }
            }
            
        }

    }
1325930
private function getRandomTags($count = 5)
    {
        $tags = ['action', 'adult', 'adventure', 'alpha', 'animals', 'animation', 'anime', 'architecture', 'art',
            'astronomy', 'baby', 'batshitinsane', 'biography', 'biology', 'book', 'books', 'business', 'business',
            'camera', 'cars', 'cats', 'cinema', 'classic', 'comedy', 'comics', 'computers', 'cookbook', 'cooking',
            'crime', 'culture', 'dark', 'design', 'digital', 'documentary', 'dogs', 'drama', 'drugs', 'education',
            'environment', 'evolution', 'family', 'fantasy', 'fashion', 'fiction', 'film', 'fitness', 'food',
            'football', 'fun', 'gaming', 'gift', 'health', 'hip', 'historical', 'history', 'horror', 'humor',
            'illustration', 'inspirational', 'internet', 'journalism', 'kids', 'language', 'law', 'literature', 'love',
            'magic', 'math', 'media', 'medicine', 'military', 'money', 'movies', 'mp3', 'murder', 'music', 'mystery',
            'news', 'nonfiction', 'nsfw', 'paranormal', 'parody', 'philosophy', 'photography', 'photos', 'physics',
            'poetry', 'politics', 'post-apocalyptic', 'privacy', 'psychology', 'radio', 'relationships', 'research',
            'rock', 'romance', 'rpg', 'satire', 'science', 'sciencefiction', 'scifi', 'security', 'self-help',
            'series', 'software', 'space', 'spirituality', 'sports', 'story', 'suspense', 'technology', 'teen',
            'television', 'terrorism', 'thriller', 'travel', 'tv', 'uk', 'urban', 'us', 'usa', 'vampire', 'video',
            'videogames', 'war', 'web', 'women', 'world', 'writing', 'wtf', 'zombies',
        ];

        shuffle($tags);

        $picked = array_slice($tags, 0, $count);

        return $picked;
    }
1024364
protected function get_sql_and_params($count = false) {
        $fields = 'c.id, c.name, c.idnumber';

        if ($count) {
            $select = "COUNT(1)";
        } else {
            $select = "$fields";
        }

        $sql = "SELECT $select
                  FROM {" . \core_competency\template_cohort::TABLE . "} tc
                  JOIN {cohort} c ON c.id = tc.cohortid
                 WHERE tc.templateid = :templateid";
        $params = array('templateid' => $this->template->get('id'));

        // Add order by if needed.
        if (!$count && $sqlsort = $this->get_sql_sort()) {
            $sql .= " ORDER BY " . $sqlsort;
        }

        return array($sql, $params);
    }
149779
public function getPages($uids, int $languageUid = null): array {
    $pages = [];

    if (is_string($uids)) {
      $uids = GeneralUtility::intExplode(',', $uids, true);
    }

    if ($uids) {
      foreach($uids as $uid) {
        $record = $this->getPage($uid, $languageUid);

        if ($record) {
          $pages[] = $record;
        }
      }
    }

    return $pages;
  }
943284
public function getTop5ArticleList($count = null)
    {
        if ($this->_blTop5Action) {
            if ($this->_aTop5ArticleList === null) {
                $this->_aTop5ArticleList = false;
                $config = \OxidEsales\Eshop\Core\Registry::getConfig();
                if ($config->getConfigParam('bl_perfLoadAktion')) {
                    // top 5 articles
                    $artList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
                    $artList->loadTop5Articles($count);
                    if ($artList->count()) {
                        $this->_aTop5ArticleList = $artList;
                    }
                }
            }
        }

        return $this->_aTop5ArticleList;
    }
347420
public function iterNextPage($count = 3)
    {
        if ($this->getPage() == 1 && $this->getPagesCount() >= $count * 2) {
            $count *= 2;
        }
        $pages = [];
        foreach (range(1, $count) as $i) {
            $page = $this->getPage() + $i;
            if ($page <= $this->getPagesCount()) {
                $pages[] = $page;
            }
        }

        return $pages;
    }
1056314
public function paginate($count, $size = null, $page = null)
    {
        $this->count = (int)$count;
        $this->size = (int)($size ?: $this->request->get('size', 10));
        $this->page = (int)($page ?: $this->request->get('page', 1));
        $this->pages = (int)ceil($this->count / $this->size);
        $this->prev = ($this->page <= $this->pages && $this->page > 1) ? $this->page - 1 : -1;
        $this->next = $this->page < $this->pages ? $this->page + 1 : -1;

        return $this;
    }
487572
protected function getSqlForSelect($count = false)
    {
        $parts = $this->sqlParts;

        if (!$parts['select']) {
            $parts['select'] = array('*');
        }

        $query = 'SELECT ' . implode(', ', $parts['select']) . ' FROM ' . $this->getFrom();

        // JOIN
        foreach ($parts['join'] as $join) {
            $query .= ' ' . strtoupper($join['type'])
                . ' JOIN ' . $join['table']
                . ' ON ' . $join['on'];
        }

        $query .= ($parts['where'] !== null ? ' WHERE ' . ((string)$parts['where']) : '')
            . ($parts['groupBy'] ? ' GROUP BY ' . implode(', ', $parts['groupBy']) : '')
            . ($parts['having'] !== null ? ' HAVING ' . ((string)$parts['having']) : '');

        if (false === $count) {
            $query .= ($parts['orderBy'] ? ' ORDER BY ' . implode(', ', $parts['orderBy']) : '')
                . ($parts['limit'] !== null ? ' LIMIT ' . $parts['limit'] : '')
                . ($parts['offset'] !== null ? ' OFFSET ' . $parts['offset'] : '');
        }

        $query .= $this->generateLockSql();

        return $query;
    }
1395
function get_suggest_tags( $count = 10)
	{
		$params = array();
		$params['count'] = intval($count);
		return $this->oauth->get( 'tags/suggestions', $params );
	}
1115219
public function paginate(int $count)
    {
        $this->count = $count;

        $this->treatmentPerPage();
                        
        if ($this->perPage !== null) {
            $this->nbPages = ceil($this->count / $this->perPage);
        } else {
            $this->nbPages = 1;
        }

        if ($this->getP !== null && $this->getP > 0 && $this->getP <= $this->nbPages && preg_match(self::REGEX_INTEGER, $this->getP)) {
            $this->currentPage = $this->getP;
        } else {
            $this->currentPage = 1;
        }

        $this->setLimitAndSetOffset();
    }
529735
private static function getNumPages(int $limit, int $count): int
    {
        return (int) ceil($count / $limit);
    }