<?
defined('BASEPATH') OR exit('No direct script access allowed');

class m_theme extends CI_Model{

	// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
	function __construct(){
		parent::__construct();

        $this->load->database();
        $this->load->library('session');
	}


    #---------------------------------------------------------------------------
    # PURPOSE :	where in theme_type list
    # CREATE  :	2018-04-09
    #---------------------------------------------------------------------------
	function theme_join_vw_content_where_in_theme_type_list($req_data){
	    # request
	    $theme_types     = $req_data['theme_types'];

        $this->db->select('a.*, b.column_name, b.content, b.partner_idx,b.sub_title,b.head_title,b.hit_count,b.editor_name');
        $this->db->where('a.is_del', 'N');
        $this->db->where('a.is_display', 'Y');
        $this->db->where('b.is_display', 'Y');
        $this->db->where('b.is_del', 'N');
        $this->db->where_in('a.theme_type', $theme_types);
        $this->db->from('theme as a');
        $this->db->join('vw_content as b', 'a.content_type=b.content_type and a.content_idx=b.idx');
        $this->db->order_by('a.content_type',  'asc');
        $this->db->order_by('a.theme_type',  'asc');
        $this->db->order_by('a.rank',  'asc');
        $res = $this->db->get();
        
        $row = $res->result_array();


        return $row;
    }






}
?>
