load->database(); $this->load->library('session'); } #--------------------------------------------------------------------------- # PURPOSE : list # CREATE : 2018-04-16 #--------------------------------------------------------------------------- function relation_article_join_news_list($req_data){ # request $content_type = $req_data['content_type']; $content_idx = $req_data['content_idx']; $this->db->select('b.*, (select homepage from press where is_del="N" and idx=b.press_idx) as press_homepage'); $this->db->where('a.content_idx', $content_idx); $this->db->where('a.content_type', $content_type); $this->db->where('b.is_del', 'N'); $this->db->from('relation_article as a'); $this->db->join('news as b', 'b.idx = a.relation_article_idx'); $this->db->order_by('a.idx', 'asc'); $res = $this->db->get(); $row = $res->result_array(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : list # CREATE : 2018-04-28 #--------------------------------------------------------------------------- function relation_article_join_column_list($req_data){ # request $content_type = $req_data['content_type']; $content_idx = $req_data['content_idx']; $this->db->where('a.content_idx', $content_idx); $this->db->where('a.content_type', $content_type); $this->db->where('b.is_del', 'N'); $this->db->from('relation_article as a'); $this->db->join('column as b', 'b.idx = a.relation_article_idx'); $this->db->order_by('a.idx', 'asc'); $res = $this->db->get(); $row = $res->result_array(); return $row; } } ?>