<?php
namespace App\Models\common;

use CodeIgniter\Model;

class CommonModel extends Model
{
    public function getVrfcCode($type)
    {

        $sql = "SELECT category, category_nm, cd, cd_nm FROM codes" .
            " WHERE category = ?" .
            " AND use_yn = 'Y'" .
            " ORDER BY view_odr";

        $query = $this->db->query($sql, [$type]);

        return $query->getResultArray();
    }

    public function getCompanyInfo($compSq)
    {
        $sql = "SELECT api_server, api_key, comp_nm FROM companies WHERE comp_sq = ?";
        $data = [$compSq];
        $query = $this->db->query($sql, $data);
        return $query->getRowArray();
    }
}