如何将表中的日期与当前日期进行比较,不包括codeigniter中的时间


How to compare date in table to current date excluding time in codeigniter

In controller:

$today = date("Y-m-d",  time());
$data['details'] = $this->admin_model->getTodayOrders('dt_manage_orders', $today); 
在模型:

public function getTodayOrders($table, $today)
{
$result=$this->db->select('*')->from($table);
return $this->db->like('Booking_Date', $today, 'before');   
}

但是它显示了一些空值

在我的表中所有的日期都是2015-09-16 11:12:50,2015-09-16 12:12:50

但是我想在我的结果日期应该是在16/09/2015这样…请帮助我如何在codeigniter

中做到这一点

试试这个:

public function getTodayOrders($table, $today){
    $this->db->select('*')->from($table);
    $this->db->like('Booking_Date', $today, 'after');
    return $this->db->get()->result_array();   
}