搜索公司时的联想搜索建议

对应API：{@link http://open.weibo.com/wiki/2/search/suggestions/companies search/suggestions/companies}

@param string $q 搜索的关键字，必须做URLencoding。必填
@param int $count 返回的记录条数，默认为10。
@return array
973047
function search_companies( $q, $count = 10)
	{
		$params = array();
		$params['q'] = $q;
		$params['count'] = $count;
		return $this->oauth->get( 'search/suggestions/companies', $params );
	}
1373578
public final function getItemIds($count = null, $offset = null)
    {
        $select = $this->_getSelect();
        if (!$select) return array();

        if ($count) {
            if ($select->hasPart(Kwf_Model_Select::LIMIT_COUNT)) {
                $ex = new Kwf_Exception("Can't use getItemIds with limit in select when \$count paramter is given. You probably should disable paging for {$this->getData()->componentClass}.");
                $ex->logOrThrow();
            }
            $select->limit($count, $offset);
        }

        return $this->getData()->parent->getComponent()->getItemIds($select);
    }
1121490
public function list($offset = 0, $count = 10, $statusList = 'CARD_STATUS_VERIFY_OK')
    {
        $params = [
            'offset' => $offset,
            'count' => $count,
            'status_list' => $statusList,
        ];

        return $this->httpPostJson('card/batchget', $params);
    }
1153034
public static function sentences($count = 3)
    {
        $sentences = array();
        for ($i = 0; $i < $count; $i++) {
            $sentences[] = static::sentence();
        }

        return $sentences;
    }
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,
                ]
            )
        )
        );
    }
761106
public function showCampaigns($count)
		{
			$form_data = array(
				'count' => $count,
				'headers' => 1
			);
			$data = $this->call('show_campaigns', $form_data, 'csv');
			$csv = new \parseCSV($data);

			$campaigns = array();

			foreach ($csv->data as $campaign_item) {
				$campaign = new Report();
				$campaign
					->setCampaignId((int)$campaign_item['Campaign ID'])
					->setListName((string)$campaign_item['List Name'])
					->setSubject((string)$campaign_item['Subject'])
					->setDate(\DateTime::createFromFormat('m/d/y h:i A', $campaign_item['Date']))
					->setRecipients((int)$campaign_item['Recipients']);

				$campaigns[] = $campaign;
			}
			return $campaigns;
		}
1178728
public function getUuids($count = 1)
    {
        $count = (int) $count;
        $response = $this->httpClient->request('GET', '/_uuids?count='.$count);

        if ($response->status != 200) {
            throw new CouchDBException('Could not retrieve UUIDs from CouchDB.');
        }

        return $response->body['uuids'];
    }
551625
public function QPayOrderQuery($params = array()){
        /*        //入参
                $params = array();
                $params["out_trade_no"] = "20160512161914_BBC";
                $params["sub_mch_id"] = "1900005911";*/
        if (empty($params["out_trade_no"])){
            throw new Exception('商户订单号参数不能缺少' ,'OUT_TRADE_NO_MUST_INPUT');
        }
        if (empty($params["sub_mch_id"])){
            throw new Exception('sub_mch_id不能缺少' ,'FEE_TYPE');
        }

        //api调用
        $qpayApi = new QpayMchAPI('https://qpay.qq.com/cgi-bin/pay/qpay_order_query.cgi', null, 10);
        $qpayApi->setMchId('1490434181');
        $qpayApi->setMchKey('8525638f86969d1de5c51ad0494f4f13');
        $ret = $qpayApi->reqQpay($params);
        return QpayMchUtil::xmlToArray($ret);
    }
314628
protected function getListReportRoute($count = false)
    {
        $list = $this->route->getList();
        $this->prepareListReportRoute($list);
        $allowed = $this->getAllowedFiltersReportRoute();

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

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

        $this->limitList($list, $this->data_limit);
        return $list;
    }
304436
public function search($query, $count = null)
    {
        $params = ['query' => [
            'q'     => $query,
            'count' => $count,
        ]];

        return $this->client->request(
            'GET',
            'users/search',
            $params
        );
    }
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());
                }
            }
            
        }

    }
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;
    }
839384
public function getLogFiles($count = 20)
    {
        $files = glob(storage_path('logs/*'));
        $files = array_combine($files, array_map("filemtime", $files));
        arsort($files);

        $files = array_map('basename', array_keys($files));

        return array_slice($files, 0, $count);
    }
720128
protected function getListReportPayment($count = false)
    {
        $list = $this->payment->getList();

        $allowed = $this->getAllowedFiltersReportPayment();
        $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;
    }
398508
public function getOne( $q = null, $collection = false )
	{
		$ret = $this->load( $q, $collection );
		$count = count($ret);

		debug_enforce( 1 === $count, "getOne expects single result, but $count given" );
		return array_shift($ret);
	}
917411
public function stream_read($count)
    {
        $ret = substr($this->_data, $this->_pos, $count);
        $this->_pos += strlen($ret);
        return $ret;
    }
254581
public static String getQuestionMark(int count) {
        StringBuilder qMark = new StringBuilder();
        for (int i = 0; i < count; i++) {
            if(i > 0) {
                qMark.append(", ");
            }
            qMark.append("?");
        }
        return qMark.toString();
    }