|
|
@@ -68,7 +68,7 @@ class Sina
|
|
|
}
|
|
|
|
|
|
//获取全部股票代码和名称列表
|
|
|
- static private function getAllStockCodeAndNameSub($exchange, $sector, $start, $end)
|
|
|
+ static public function getAllStockCodeAndName($exchange, $sector, $start, $end)
|
|
|
{
|
|
|
$url = "http://hq.sinajs.cn/list=";
|
|
|
$data['exchange'] = $exchange;
|
|
|
@@ -94,21 +94,6 @@ class Sina
|
|
|
|
|
|
}
|
|
|
|
|
|
- //获取全部股票代码和名称列表
|
|
|
- static public function getAllStockCodeAndName()
|
|
|
- {
|
|
|
- //循环遍历所有可能的股票代码,返回不为空,即可入库。一次最多获取500个。
|
|
|
-
|
|
|
- //深证主板
|
|
|
- self::getAllStockCodeAndNameSub(STOCK_EXCHANGE_SZ, STOCK_SECTOR_SZ_MAIN, 1, 500);
|
|
|
- self::getAllStockCodeAndNameSub(STOCK_EXCHANGE_SZ, STOCK_SECTOR_SZ_MAIN, 501, 1000);
|
|
|
- self::getAllStockCodeAndNameSub(STOCK_EXCHANGE_SZ, STOCK_SECTOR_SZ_MAIN, 1001, 1500);
|
|
|
- self::getAllStockCodeAndNameSub(STOCK_EXCHANGE_SZ, STOCK_SECTOR_SZ_MAIN, 1501, 1999);
|
|
|
-
|
|
|
- return;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/****
|
|
|
* @param $code
|
|
|
* @return string
|