<?php
class Barang_model extends CI_Model {
    public function get_by_barcode_or_name($term) {
        return $this->db
            ->like('barcode_ecer', $term)
            ->or_like('nama_barang', $term)
            ->get('tb_barang')
            ->result();
    }

    public function get_by_barcode($barcode) {
        return $this->db
            ->where('barcode_ecer', $barcode)
            ->get('tb_barang')
            ->row();
    }
}
