按天返回热门微博转发榜的微博列表

对应API：{@link http://open.weibo.com/wiki/2/statuses/hot/repost_daily statuses/hot/repost_daily}

@param int $count 返回的记录条数，最大不超过50，默认为20。
@param int $base_app 是否只获取当前应用的数据。0为否（所有数据），1为是（仅当前应用），默认为0。
@return array
348816
function repost_daily( $count = 20, $base_app = 0)
	{
		$params = array();
		$params['count'] = intval($count);
		$params['base_app'] = intval($base_app);
		return $this->oauth->get('statuses/hot/repost_daily',  $params);
	}
504024
protected function getVerifiedCount($count, $min = 1, $max = 100)
    {
        settype($count, "integer");
        settype($min, "integer");
        settype($max, "integer");

        // If $min is greater than $max,
        // use the smallest of the two ($max)
        if ($min > $max) $min = $max;

        if ($count < $min)
        {
            $count = $min;
        }
        elseif ($count > $max)
        {
            $count = $max;
        }

        return $count;
    }
117243
public function getCounters($baseQuery = null)
    {
        if ($this->counters !== null) {
            return $this->counters;
        }
        /** @var \yii\db\ActiveRecord $modelClass */
        $modelClass   = $this->modelClass;
        $queryBuilder = $modelClass::getDb()->getQueryBuilder();
        if ($baseQuery === null) {
            $baseQuery = $modelClass::find();
        }
        $params = [];
        $select = [];
        $joins = [];
        $joinWith = [];
        foreach ($this->countableQueries() as $queryNames) {
            /** @var ActiveQuery $query */
            $query     = clone $baseQuery;
            foreach (array_filter(array_map('trim', explode(',', $queryNames))) as $queryName) {
                $query->$queryName();
            }
            $params    = array_merge($params, $query->params);
            $condition = $queryBuilder->buildCondition($query->where, $params);
            $select[]  = "COUNT(t.id) FILTER (WHERE $condition) AS \"$queryNames\"";

            $joinWith = array_merge($joinWith, is_array($query->joinWith) ? $query->joinWith : []);
            if (!is_array($query->join)) {
                continue;
            }

            foreach ($query->join as $join) {
                if (in_array($join, $joins)) {
                    continue;
                }
                $joins[] = $join;
            }
        }
        if (empty($select)) {
            return $this->counters = [];
        }

        // allow to modify query before calling this method, for example add auth conditions
        $baseQuery = clone $this;
        $baseQuery->join = $joins;
        $baseQuery->joinWith = $joinWith;
        return $this->counters = $baseQuery
            ->select($select)
            ->from(['t' => $modelClass::tableName()])
            ->addParams($params)
            ->createCommand($modelClass::getDb())
            ->queryOne();
    }
841851
public function get_values_count($table, $field, array $where = [], $limit, $start, $php = false)
  {
		if ( ( $table = $this->table_full_name($table, 1) )  && ( $m = $this->db->modelize($table) ) && \count($m['fields']) > 0 )
		{
			$r = '';
			if ( $php ){
				$r .= '$db->query("';
			}
      if ( !isset($m['fields'][$field]) ){
        die("The column $field doesn't exist in $table");
      }
			$r .= "SELECT COUNT(*) AS num, `$field` AS val FROM $table";
			if ( \count($where) > 0 ){
        $r .= PHP_EOL . $this->db->get_where($where, $table);
      }
      $r .= PHP_EOL . "GROUP BY `$field`";
      $r .= PHP_EOL . "ORDER BY `$field`";
      if ( $limit ){
  			$r .= PHP_EOL . $this->get_limit([$limit, $start]);
      }
			if ( $php ){
				$r .= '");';
			}
			return $r;
		}
		return false;
  }
165905
public function readFloats($count)
    {
        $floats = array();

        for ($i = 0; $i < $count; $i++) {
            $float = $this->readFloat();

            if (! is_nan($float)) {
                $floats[] = $float;
            }
        }

        return $floats;
    }
911878
protected function baseQuery()
    {
        if (empty($this->baseQuery)) {
            if (isset($this->parent->{$this->foreignKey})) {
                // 关联查询带入关联条件
                $this->query->where($this->localKey, '=', $this->parent->{$this->foreignKey});
            }

            $this->baseQuery = true;
        }
    }
1272088
public static function getValues($count)
    {
        if (!Int::is($count) || $count < 1) {
            throw new \InvalidArgumentException("The \$count parameter must be of type int and greater than zero.");
        }

        $ret = [];
        $flag = 1;
        for ($i = 0; $i < $count; $i++) {
            $ret[] = $flag;
            $flag <<= 1;
        }

        return $ret;
    }
1038154
public function delete()
    {

        //没有设置条件不能删除
        if ($this->condition->count() < 1) {
            throw new BaseException(QueryException::DELETE_NOT_WHERE);
        }
        $whereStr       = (string)$this->condition->compile();
        $whereArguments = $this->condition->arguments();
        $sql            = "DELETE FROM {$this->getFrom()} WHERE ".$whereStr;
        return $this->connection->executeUpdate($sql, $whereArguments);
    }
1339782
public function list(string $type, int $offset = 0, int $count = 20)
    {
        return Response::json($this->curl->post(self::LIST.$this->access_token, json_encode([
                    'type' => $type,
                    'offset' => $offset,
                    'count' => $count,
                ]
            )
        )
        );
    }
580387
public function count() {
        $sql    = $this->getSQL();
        $values = $this->values;
        if ($sql) {
            try {
                $statement = $this->dialect->prepare($sql);
                $cnt       = false;
                if ($this->batch) {
                    $cnt = 0;
                    foreach ($this->data as $data) {
                        list($da, $where) = $data;
                        foreach ($values as $value) {
                            list ($name, $val, $type, , $rkey) = $value;
                            $rval = isset($where[ $rkey ]) ? $where[ $rkey ] : (isset($da[ $rkey ]) ? $da[ $rkey ] : $val);
                            if (!$statement->bindValue($name, $rval, $type)) {
                                $this->errorSQL    = $sql;
                                $this->errorValues = $values->__toString();
                                $this->error       = 'can not bind the value ' . $rval . '[' . $type . '] to the argument:' . $name;

                                return false;
                            }
                        }
                        $rst = $statement->execute();
                        QueryBuilder::addSqlCount();

                        if ($rst) {
                            $cnt += $statement->rowCount();
                        } else {
                            $this->dumpSQL($statement);

                            break;
                        }
                    }
                } else {
                    foreach ($values as $value) {
                        list ($name, $val, $type) = $value;
                        if (!$statement->bindValue($name, $val, $type)) {
                            $this->errorSQL    = $sql;
                            $this->errorValues = $values->__toString();
                            $this->error       = 'can not bind the value ' . $val . '[' . $type . '] to the argument:' . $name;

                            return false;
                        }
                    }
                    $rst = $statement->execute();
                    QueryBuilder::addSqlCount();

                    if ($rst) {
                        $cnt = $statement->rowCount();
                    } else {
                        $this->dumpSQL($statement);
                    }
                }

                if ($statement) {
                    $statement->closeCursor();
                    $statement = null;
                }

                return $cnt;
            } catch (\PDOException $e) {
                $this->exception   = $e;
                $this->error       = $e->getMessage();
                $this->errorSQL    = $sql;
                $this->errorValues = $values->__toString();

                return false;
            }
        } else {
            $this->error       = 'Can not generate the delete SQL';
            $this->errorSQL    = '';
            $this->errorValues = $values->__toString();
        }

        return false;
    }
179794
public function getLastStatusesFromPage($page_name, $count = 100, $fields = 'id,created_time,message,picture,full_picture')
  {
    try {
      $data = (new \Facebook\FacebookRequest(
        $this->session, 'GET', '/'.$page_name.'/feed?fields='.$fields.'&limit='.$count
      ))->execute()->getGraphObject()->getPropertyAsArray("data");
      return $data;
    } catch (\Exception $e) {
      return $this->debug_mode ? $e->getMessage() : null;
    }
    return null;
  }
751627
public function verifyReturn(){
        if(empty($_GET)) {//判断POST来的数组是否为空
            return false;
        }
        else {
            //生成签名结果
            $isSign = $this->getSignVeryfy($_GET, $_GET["sign"]);
            //获取支付宝远程服务器ATN结果（验证是否是支付宝发来的消息）
            $responseTxt = 'true';
            if (! empty($_GET["notify_id"])) {$responseTxt = $this->getResponse($_GET["notify_id"]);}

            //写日志记录
            //if ($isSign) {
            //	$isSignStr = 'true';
            //}
            //else {
            //	$isSignStr = 'false';
            //}
            //$log_text = "responseTxt=".$responseTxt."\n return_url_log:isSign=".$isSignStr.",";
            //$log_text = $log_text.createLinkString($_GET);
            //logResult($log_text);

            //验证
            //$responsetTxt的结果不是true，与服务器设置问题、合作身份者ID、notify_id一分钟失效有关
            //isSign的结果不是true，与安全校验码、请求时的参数格式（如：带自定义参数等）、编码格式有关
            if (preg_match("/true$/i",$responseTxt) && $isSign) {
                return true;
            } else {
                return false;
            }
        }
    }
564625
protected function getListLanguage($count = false)
    {
        $list = $this->language->getList();

        $allowed = $this->getAllowedFiltersLanguage();
        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('code' => 'asc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        $this->prepareListLanguage($list);
        return $list;
    }
235289
public function db($useBaseQuery = true)
    {
        if ($this->queryInstance) {
            return $this->queryInstance;
        }

        $query = $this->buildQuery();

        // 软删除
        if (property_exists($this, 'withTrashed') && !$this->withTrashed) {
            $this->withNoTrashed($query);
        }

        // 全局作用域
        if (true === $useBaseQuery && method_exists($this, 'base')) {
            call_user_func_array([$this, 'base'], [ & $query]);
        }

        $globalScope = is_array($useBaseQuery) && $useBaseQuery ? $useBaseQuery : $this->globalScope;

        if ($globalScope && false !== $useBaseQuery) {
            $query->scope($globalScope);
        }

        // 返回当前模型的数据库查询对象
        return $query;
    }
762253
public function getBatchCards($offset = 0, $count = 50)
    {
        $result = $this->httpPost(static::WECHAT_GET_BATCH_CARD_URL . 'access_token=' . $this->getAccessToken(), [
            'offset' => $offset,
            'count' => $count
        ]);

        return isset($result['card_id_list']) ? $result['card_id_list'] : false;
    }
717594
protected function getListReportShipping($count = false)
    {
        $list = $this->shipping->getList();
        $allowed = $this->getAllowedFiltersReportShipping();

        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('id' => 'asc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        return $list;
    }
431959
public function fetched_count()
    {
        if ($this->statement) {
            return $this->statement->num_rows;
        }
        
        if (!$this->mysqli_result) {
            $this->last_error_id = "db_result_error";
            return false;
        }
        
        // by update, insert, delete it is not an object
        // by select it is an object
        // crazy!
        
        if (!is_object($this->mysqli_result)) {
            return false;
        }
        
        return $this->mysqli_result->num_rows;
    }