-1
CodeIgniterの完了したときに、私は、トランザクションが完了したとき、私はデータからのforeachと試みるが、株価が正しくトランザクションが
CONTROLLER低下しない在庫品を減らしたいの在庫を減らす:
for ($i=0; $i < $count ; $i++) {
//SAVE DETAIL PENJUALAN
$data[] = array(
'nonota' => $this->input->post('nonota',TRUE),
'id_brg' => $this->input->post('kd_brg',TRUE)[$i],
'nama_brg' => $this->input->post('nama',TRUE)[$i],
'jml_brg' => $this->input->post('jml',TRUE)[$i],
'harga_brg' => $this->input->post('harga',TRUE)[$i],
);
//DELETE CART
$cart[] = array(
'rowid' => $this->input->post('rowid',TRUE)[$i],
'qty' => 0
);
$update[] = array(
'id' => $this->input->post('kd_brg',TRUE)[$i],
'stok' => 'stok' - $this->input->post('jml',TRUE)[$i]
);
$this->M_penjualan->updatestock($update,'tbl_barang');
}
モデルを
function updatestock($update) {
$this->db->update_batch('tbl_barang',$update,'id');
}
在庫を減らすコードはどこですか? –
関数updatestock($ update){ $ this-> db-> update_batch( 'tbl_barang'、$ update、 'id'); } –