瀏覽代碼

修改bug

chenbo 4 年之前
父節點
當前提交
f8341a0c86
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/input_sina_simple.class.php

+ 3 - 1
lib/input_sina_simple.class.php

@@ -8,6 +8,8 @@
 
 class Input_sina_simple
 {
+    private $globalUrl = "http://hq.sinajs.cn/list=";
+
     static private function curl_get_data($url, $codeList){           //一次批量获取股票列表
         if (empty($codeList)) {
             return 0;
@@ -43,11 +45,11 @@ class Input_sina_simple
     //获取指定条件的股票代码和名称列表
     static private function getPartStockCodeAndNameList($exchange, $sector, $start, $end)
     {
-        $url = "http://hq.sinajs.cn/list=";
         $data['exchange'] = $exchange;
         $data['sector'] = $sector;
         $codeList = array();
         $codeIndex = 0;
+        $url = $this->globalUrl;
         for($code = $start;$code < $end; $code++){
             $codeStr = sprintf('%06s', $code);
             $url .= 's_'.$exchange.$codeStr.',';