Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
683 B
1
Indexable
Never
public function find_all()
    {
        return $this->db->table('tbl_barang')
            ->orderBy('id_barang', 'ASC')
            ->get()
            ->getResultArray();
    }

public function join_kategori_satuan()
    {
        return $this->db->table('tbl_barang')
            ->join('tbl_kategori', 'tbl_kategori.id_kategori=tbl_barang.id_kategori')
            ->join('tbl_satuan', 'tbl_satuan.id_satuan=tbl_barang.id_satuan')
            ->get()
            ->getResultArray();
    }

public function update_data($data)
    {
        $this->db->table('tbl_barang')
            ->where('id_barang', $data['id_barang'])
            ->update($data);
    }