|
|
@@ -150,6 +150,31 @@ class Input_sina_simple
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ //获取index_day_k 涨跌幅数据
|
|
|
+ static public function getIndexDayKIncreaseRatio($indexList)
|
|
|
+ {
|
|
|
+ $codeList = array();
|
|
|
+ $codeIndex = 0;
|
|
|
+ $url = self::GLOBAL_URL;
|
|
|
+ foreach ($indexList as $item) {
|
|
|
+ $codeStr = sprintf('%06s', $item['code']);
|
|
|
+ $url .= 's_'.$item['exchange'].$codeStr.',';
|
|
|
+ $codeList[$codeIndex] = $codeStr;
|
|
|
+ $codeIndex++;
|
|
|
+ }
|
|
|
+ $contentList = self::curl_get_data($url, $codeList);
|
|
|
+ foreach ($contentList as $key => $item) {
|
|
|
+ $data['code'] = $item['code'];
|
|
|
+ $data['name'] = trim($item[0]);
|
|
|
+ $data['date'] = date('Ymd',time());
|
|
|
+ $data['increase_ratio'] = floatval(trim($item[3]));
|
|
|
+ if (!empty($item[0])) { //判断非法股票代码
|
|
|
+ Index_day_k::addOrUpdateByCodeDate($data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
?>
|