db->where('is_del', 'N'); $this->db->where('depth', '1'); $this->db->from('main_category'); $this->db->order_by('p_category_code asc, depth asc, category_code asc'); $this->db->limit(3, 0); $res = $this->db->get(); $cat1 = $res->result_array(); ?>

홈

db->where('is_del', 'N'); $this->db->where('depth', '2'); $this->db->from('main_category'); $this->db->order_by('p_category_code asc, depth asc, category_code asc'); $res = $this->db->get(); $cat2 = $res->result_array(); $cat_compare = ''; ?> $data): ?>
db->where('is_del', 'N'); $this->db->from('main_category_company'); $this->db->order_by('category_code1,category_code2,display_sort',"asc"); $res = $this->db->get(); $cat2 = $res->result_array(); $cat_compare = ''; foreach ($cat2 as $key => $data): $code = $data['category_code1']."-".$data['category_code2']; ?>