chenbo лет назад: 4
Родитель
Сommit
93f62fb39c
3 измененных файлов с 7 добавлено и 62 удалено
  1. 7 1
      api/v1.0/index_day_k.php
  2. 0 19
      lib/index_day_k.class.php
  3. 0 42
      lib/table/table_index_day_k.class.php

+ 7 - 1
api/v1.0/index_day_k.php

@@ -33,7 +33,13 @@ try {
         echo action_msg("order参数不正确",101);
         return;
     }
-    $stock_info=Index_day_k::getIndexListHistroy($code,$start_date,$end_date,$order);
+
+    //获取列表
+    $filter = array(
+        'code' => array($code, '=s'),
+        'date' => array($end_date, 'date_between', AddOrSubDate($start_date, -1)),
+    );
+    $stock_info = Index_day_k::getListOrderByDate($filter, 0, 0, 0,$order);
 
     if(!empty($stock_info)){
         $params=array();

+ 0 - 19
lib/index_day_k.class.php

@@ -85,25 +85,6 @@ class Index_day_k {
     }
 
 
-    /**
-     * @param $start_date
-     * @param $end_date
-     * @param $index_type
-     * @param $num
-     * @param $order
-     * @return array
-     * wanggangtao
-     * 获取时间段指数信息
-     */
-    static public function getIndexListHistroy($code,$start_date,$end_date,$order)
-    {
-        $Table_index_day_k = new Table_index_day_k();
-        return $Table_index_day_k->getIndexListHistroy($code,$start_date,$end_date,$order);
-    }
-
-
-
-
 
 }
 ?>

+ 0 - 42
lib/table/table_index_day_k.class.php

@@ -55,48 +55,6 @@ class Table_index_day_k extends Table {
     //-------------------------------
 
 
-    /****
-     * @param $start_date
-     * @param $end_date
-     * @param $index_type
-     * @param $num
-     * @param $order_info
-     * @return array
-     * wanggangtao
-     */
-    public function getIndexListHistroy($code,$start_date,$end_date,$order_info)
-    {
-        //查询语句必须用sql_check_input检查参数
-        $stock_code= $this->pdo->sql_check_input(array('string', $code));
-        $start_date= $this->pdo->sql_check_input(array('number', $start_date));
-        $end_date = $this->pdo->sql_check_input(array('number', $end_date));
-        $sql = "select * from ". $this->table_fullname ." where 1=1 ";
-        $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;
-
-        if($order_info==1){
-            $order=" order by index_day_k_date desc ";
-        }else{
-            $order=" order by index_day_k_date asc ";
-        }
-        $sql.=$order;
-
-        $rs = $this->pdo->sqlQuery($sql);
-        $r  = array();
-        if($rs){
-            foreach($rs as $key => $val){
-
-                $r[$key] = $this->dataToAttr($val);
-            }
-            return $r;
-        }else{
-            return $r;
-        }
-    }
-