function insertPayment($uid, $amount,$rand) {
$this->db->insert('payments', array(
'amount' => (float)$amount,
'user' => $uid,
'hash' =>$rand,
'time' => time(),
'status' => 0
));
return $this->db->insert_id();
}Kısmını şununla değiştirin:
function insertPayment($uid, $amount,$rand) {
$this->db->insert('payments', array(
'amount' => (float)$amount,
'user' => $uid,
'hash' =>$rand,
'time' => time(),
'status' => 0
));
return [
'id' => $this->db->insert_id(),
'hash' => $rand
];
}Ardından şöyle çekebilirsiniz:
$data = $this->Payment_Model->insertPayment($this->user['id'], $this->input->post('amount'));
$order_id = $data['id'];
$hash = $data['hash'];