1 回答
TA贡献1836条经验 获得超3个赞
$id = $this->report_model->get_by_id($id);
$price_now_query = $this->db->query("SELECT `price_now ` FROM `table_report` Where `date_report` IS BETWEEN (CURRENT_DATE() - INTERVAL 1 MONTH) AND CURRENT_DATE() AND `id_head_report`=$id");
// CURRENT_DATE() - INTERVAL 1 MONTH - will get previous-month data
$price_now = []
if ($price_now_query && $price_now_query->num_rows() > 0) {
$price_now = $price_now_query->row();
}
$row = $this->report_model->get_by_id($id);
if ($row) {
$data = array( 'button' => 'Update','action' =>
site_url('controller_report/update_report'),
'id_report ' => set_value('id_report ', $row->id_report ),
'id_head_report ' => set_value('id_head_report ', $row->id_head_report ),
'date_report' => set_value('date_report', $row->date_report),
'price_now' => set_value('price_now', $row->price_now),
'price_previous' => $price_previous,
}
);
- 1 回答
- 0 关注
- 97 浏览
添加回答
举报