mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fixed SQL error
This commit is contained in:
@@ -15,12 +15,16 @@ class Dayswithqso_model extends CI_Model
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
$sql = "select year(COL_TIME_ON) Year, count(distinct COL_TIME_ON) Days from "
|
||||
|
||||
|
||||
$sql = "select year(COL_TIME_ON) Year, COUNT(DISTINCT TO_DAYS(COL_TIME_ON)) as Days from "
|
||||
.$this->config->item('table_name'). " thcv
|
||||
where station_id = " . $station_id . " and COL_TIME_ON is not null group by year";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
print_r($query->result());
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user