display proper oldest record based on the sent date

This commit is contained in:
SJ
2013-10-19 10:39:10 +02:00
parent 6aad513879
commit 447ea6c47f
3 changed files with 6 additions and 2 deletions

View File

@ -169,8 +169,8 @@ class ModelHealthHealth extends Model {
public function get_oldest_record_ts() {
$data = array();
$query = $this->db->query("SELECT `sent` AS `oldest_record_ts` FROM " . TABLE_META . " WHERE deleted=0 ORDER BY `arrived` ASC LIMIT 1");
$query = $this->db->query("SELECT `sent` AS `oldest_record_ts` FROM " . TABLE_META . " WHERE `deleted`=0 and `sent` > 837381600 ORDER BY `sent` ASC LIMIT 1");
if(isset($query->rows)) {
$data = array_pop($query->rows);
} else {