Cloudlog/application/models/Dayswithqso_model.php
Peter Goodhall f8b6a6e83a Revert "Merge pull request #584 from AndreasK79/longest_streak"
This reverts commit ae11d17ff0, reversing
changes made to ccac7f1828.
2020-08-29 17:04:46 +01:00

29 行
无行尾
719 B
PHP

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Dayswithqso_model extends CI_Model
{
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function getDaysWithQso()
{
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$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);
return $query->result();
}
}