|
|
@@ -101,6 +101,53 @@ class Input_sina_simple
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ //获取指定条件的股票代码和名称列表
|
|
|
+ static public function getAllIndexCodeAndNameList()
|
|
|
+ {
|
|
|
+ $i = 0;
|
|
|
+ $index[$i]['code'] = '000001';
|
|
|
+ $index[$i]['name'] = '上证指数';
|
|
|
+ $index[$i]['exchange'] = 'sh';
|
|
|
+ $index[$i]['sector'] = 10;
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ $index[$i]['code'] = '399001';
|
|
|
+ $index[$i]['name'] = '深成指数';
|
|
|
+ $index[$i]['exchange'] = 'sz';
|
|
|
+ $index[$i]['sector'] = 20;
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ $index[$i]['code'] = '000016';
|
|
|
+ $index[$i]['name'] = '上证50指数';
|
|
|
+ $index[$i]['exchange'] = 'sh';
|
|
|
+ $index[$i]['sector'] = 10;
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ $index[$i]['code'] = '399300';
|
|
|
+ $index[$i]['name'] = '沪深300';
|
|
|
+ $index[$i]['exchange'] = 'sz';
|
|
|
+ $index[$i]['sector'] = 20;
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ $index[$i]['code'] = '399006';
|
|
|
+ $index[$i]['name'] = '创业板指数';
|
|
|
+ $index[$i]['exchange'] = 'sz';
|
|
|
+ $index[$i]['sector'] = 22;
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ $index[$i]['code'] = '000688';
|
|
|
+ $index[$i]['name'] = '科创50指数';
|
|
|
+ $index[$i]['exchange'] = 'sh';
|
|
|
+ $index[$i]['sector'] = 11;
|
|
|
+
|
|
|
+ foreach ($index as $key => $item) {
|
|
|
+ if (!empty($item['code'])) { //判断非法股票代码
|
|
|
+ Index::addOrUpdateByCode($item['code']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
?>
|