取日期如何獲取由過去的7天笨日期....如何由過去的7天
public function get_data() {
$this->db->select('*');
$this->db->select_sum('total_sale');
$this->db->where('store_date BETWEEN CURDATE() - INTERVAL 7 DAY AND CURDATE()');
$query = $this->db->get('one_month_report');
if ($query->num_rows() > 0) {
return $query->result();
} else {
return FALSE;
}
}
請告訴我什麼是錯的內部查詢 – Som
$這個 - > DB->在哪裏( 'store_date> DATE_SUB(NOW(),區間7日)'); – Kunal
感謝您的回覆,但它不返回任何東西 – Som