【发布时间】:2016-12-09 07:25:40
【问题描述】:
我的计算有点问题,当我传递折扣和借方值时,它正在完成它的工作,但是当折扣和借方的值什么都不是时,它返回一个空白页。这是我的模型.. CODEIGNITER。
function createInvoice() {
$this->load->helper('date');
$date = date('Y-m-d H:i:s');
$data = array(
'Date' => $date,
'Terms_Of_Payment' => $this->input->post('termsOfPayment'),
'Sub_Total' => $this->input->post('subTotal'),
'Total' => $this->input->post('total') - $this->input->post('discount'),
'Discount' => $this->input->post('discount'),
'Debit' => $this->input->post('debit'),
'Payment_Cridet' => $this->input->post('total') - $this->input->post('debit') - $this->input->post('discount'),
'Note' => $this->input->post('note'),
'Customer_ID' => $this->input->post('customerId'),
'User_ID' => $this->session->userdata('id'));
$this->db->insert('invoice', $data);
return ($this->db->affected_rows() != 1) ? false : true;
}
【问题讨论】:
标签: codeigniter codeigniter-2 codeigniter-3