Попробуйте использовать это
public $table = 'm_slow_log';
function getbetween() {
$where = "start_time BETWEEN CAST('2020-01-15%' AS DATE) AND CAST('2020-01-22%' AS DATE)";
$this->db->where($where);
$this->db->from($this->table);
return $this->db->count_all_results();
}
или вы можете установить дату на контроллере / просмотр
public $table = 'm_slow_log';
function getbetween($f, $t) {
$this->db->where("start_time BETWEEN '$f' AND '$t'");
$this->db->where($where);
$this->db->from($this->table);
return $this->db->count_all_results();
}