我在 Codeigniter 中創(chuàng)建了一個(gè)頁面,顯示我當(dāng)天(今天)的訂單,現(xiàn)在我想創(chuàng)建一個(gè)(本周)。到今天,我有這個(gè)代碼,并且工作正常:$dataatual = date('Y-m-d');if($status["today"] === true){ $this->db->where('DATE(gp.data)', $dataatual);}我試試這個(gè),但不知道如何創(chuàng)建到本周(星期一開始)$first_date = date('Y-m-d'); //tried in manual date (2019-08-11)$second_date = date('Y-m-d'); //tried in manual date (2019-08-17)if($status["thisweek"] === true){ $this->db->where('DATE(gp.data) >=', $first_date); $this->db->where('DATE(gp.data) <=', $second_date);}
在 Codeigniter 中獲取日期之間的訂單
慕工程0101907
2021-11-26 16:08:25