Код: Выделить всё
public function downloadOrderDailyReport()
{
//$this->load->helper('date');
$timestamp = date("Y-m-d");
$this->db->select("O.created, O.paymentMethod,B.SKU as sku, B.name as Bname, B.author as authors, B.edition,B.MRP as mrp, OD.status as order_status");
$this->db->from("orders AS O");
$this->db->join("users AS U", 'O.userid=U.id');
$this->db->join("orderDetail AS OD","O.parentId=OD.orderId", 'LEFT');
$this->db->join("books AS B","OD.bookId=B.id", 'LEFT');
$this->db->where("O.parentId !=", NULL);
$this->db->where(date('O.created'), $timestamp);
$query = $this->db->get();
return $orders = $query && $query->num_rows() ? $query->result() : [];
}
Мне нужно сравнивать только сегодняшнюю дату, а не время. Когда я удаляю второй вызовwhere(), метод работает нормально (не ломается).
Подробнее здесь: https://stackoverflow.com/questions/486 ... s-query-fa
Мобильная версия