|
@@ -114,43 +114,27 @@ class Table_index_day_k extends Table {
|
|
|
* @return array
|
|
* @return array
|
|
|
* wanggangtao
|
|
* wanggangtao
|
|
|
*/
|
|
*/
|
|
|
- public function getIndexListHistroy($start_date,$end_date,$index_type,$num,$order_info)
|
|
|
|
|
|
|
+ public function getIndexListHistroy($code,$start_date,$end_date,$traceback_days,$order_info)
|
|
|
{
|
|
{
|
|
|
//查询语句必须用sql_check_input检查参数
|
|
//查询语句必须用sql_check_input检查参数
|
|
|
|
|
+ $stock_code= $this->pdo->sql_check_input(array('string', $code));
|
|
|
$start_date= $this->pdo->sql_check_input(array('number', $start_date));
|
|
$start_date= $this->pdo->sql_check_input(array('number', $start_date));
|
|
|
$end_date = $this->pdo->sql_check_input(array('number', $end_date));
|
|
$end_date = $this->pdo->sql_check_input(array('number', $end_date));
|
|
|
$sql = "select * from ". $this->table_fullname ." where 1=1 ";
|
|
$sql = "select * from ". $this->table_fullname ." where 1=1 ";
|
|
|
- if($index_type==1){
|
|
|
|
|
- $stock_code="000001";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }else if($index_type==2){
|
|
|
|
|
- $stock_code="399001";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }else if($index_type==3){
|
|
|
|
|
- $stock_code="000016";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }else if($index_type==4){
|
|
|
|
|
- $stock_code="399300";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }else if($index_type==5){
|
|
|
|
|
- $stock_code="399006";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }else if($index_type==6){
|
|
|
|
|
- $stock_code="000688";
|
|
|
|
|
- $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
- }
|
|
|
|
|
- $where =" and index_day_k_timestamp between ".$start_date." and ".$end_date ;
|
|
|
|
|
|
|
+ $sql.=" and index_day_k_code=".$stock_code ;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $where =" and index_day_k_date >= ".$start_date." and index_day_k_date<=".$end_date ;
|
|
|
$sql.=$where;
|
|
$sql.=$where;
|
|
|
|
|
|
|
|
if($order_info==1){
|
|
if($order_info==1){
|
|
|
- $order=" order by index_day_k_timestamp desc ";
|
|
|
|
|
|
|
+ $order=" order by index_day_k_date desc ";
|
|
|
}else{
|
|
}else{
|
|
|
- $order=" order by index_day_k_timestamp asc ";
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $order=" order by index_day_k_date asc ";
|
|
|
}
|
|
}
|
|
|
$sql.=$order;
|
|
$sql.=$order;
|
|
|
|
|
|
|
|
- $limit=" limit ".$num;
|
|
|
|
|
|
|
+ $limit=" limit ".$traceback_days;
|
|
|
$sql.=$limit;
|
|
$sql.=$limit;
|
|
|
|
|
|
|
|
|
|
|