You'll need to get a date in your where clause. Something like this should do the trick:
function get_product($productID){
$this->db->select()
->from('products')
->where('productID',$productID)
->where('end_date >=', date('Y-m-d H:i:s', strtotime('- 1 day')))
->limit(20);
$query = $this->db->get();
return $query->first_row('array');
}