Fixed bug where Month total on dashboard wasn't always displaying correctly.

pull/455/head
Peter Goodhall 2020-03-31 15:27:29 +01:00
rodzic 0a7b59608b
commit 17dcf68d3c
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -703,7 +703,12 @@ class Logbook_model extends CI_Model {
$station_id = $CI->Stations->find_active();
$morning = date('Y-m-01 00:00:00');
$night = date('Y-m-30 23:59:59');
$date = new DateTime('now');
$date->modify('last day of this month');
$night = $date->format('Y-m-d')." 23:59:59";
$query = $this->db->query('SELECT COUNT( * ) as count FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_TIME_ON between \''.$morning.'\' AND \''.$night.'\'');
if ($query->num_rows() > 0)