|
|
@@ -176,25 +176,51 @@ class Table_day_k extends Table {
|
|
|
* @return array
|
|
|
*
|
|
|
*/
|
|
|
- public function get_day_k_info($code,$start_date,$end_date,$order_info)
|
|
|
+ public function get_day_k_info($code,$start_date,$end_date,$order_info,$fq_price)
|
|
|
{
|
|
|
//查询语句必须用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 ";
|
|
|
- $where =" and day_k_code=".$stock_code ." and day_k_timestamp between ".$start_date." and ".$end_date ;
|
|
|
- $sql.=$where;
|
|
|
- if($order_info==1)
|
|
|
- {
|
|
|
- $order=" order by day_k_timestamp desc";
|
|
|
+ $fq_price = $this->pdo->sql_check_input(array('number', $fq_price));
|
|
|
+
|
|
|
+ if($fq_price==1){//复权
|
|
|
+
|
|
|
+ $sql = "select * from ". $this->table_fullname ." where 1=1 ";
|
|
|
+ $where =" and day_k_code=".$stock_code ." and day_k_date>= ".$start_date." and day_k_date<= ".$end_date ;
|
|
|
+ $sql.=$where;
|
|
|
+
|
|
|
+
|
|
|
+ $sql="select* from(".$sql.")a left join boniu_day_k_qfq b on a.day_k_code=b.day_k_qfq_code and b.day_k_qfq_date=a.day_k_date";
|
|
|
+
|
|
|
+ if($order_info==1)
|
|
|
+ {
|
|
|
+ $order=" order by day_k_date desc";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $order=" order by day_k_date asc";
|
|
|
+ }
|
|
|
+
|
|
|
+ $sql.=$order;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $order=" order by day_k_timestamp asc";
|
|
|
+ $sql = "select * from ". $this->table_fullname ." where 1=1 ";
|
|
|
+ $where =" and day_k_code=".$stock_code ." and day_k_date>= ".$start_date." and day_k_date<= ".$end_date ;
|
|
|
+ $sql.=$where;
|
|
|
+ if($order_info==1)
|
|
|
+ {
|
|
|
+ $order=" order by day_k_date desc";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $order=" order by day_k_date asc";
|
|
|
+ }
|
|
|
+
|
|
|
+ $sql.=$order;
|
|
|
}
|
|
|
|
|
|
- $sql.=$order;
|
|
|
$rs = $this->pdo->sqlQuery($sql);
|
|
|
$r = array();
|
|
|
if($rs){
|