load->database(); $this->load->library('session'); } #--------------------------------------------------------------------------- # PURPOSE : list # CREATE : 2018-04-11 #--------------------------------------------------------------------------- function ranking_list($req_data){ # request $offset = $req_data['offset']; $limit = $req_data['limit']; $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->where('is_del', 'N'); $this->db->where('ranking_type', $ranking_type); $this->db->where('content_type', $content_type); $this->db->from('ranking'); $this->db->limit($limit, $offset); $this->db->order_by('rank', 'asc'); $res = $this->db->get(); $row = $res->result_array(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : ranking_news join # CREATE : 2018-04-28 #--------------------------------------------------------------------------- function ranking_join_news_list($req_data){ # request $offset = $req_data['offset']; $limit = $req_data['limit']; $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->select('a.*, b.content, b.org_url, b.press_name, b.hit_count, b.comment_count, b.review_count1, b.display_date, (select homepage from press where is_del="N" and idx=b.press_idx) as press_homepage'); $this->db->where('b.is_del', 'N'); $this->db->where('b.is_display', 'Y'); $this->db->where('a.is_del', 'N'); $this->db->where('a.ranking_type', $ranking_type); $this->db->where('a.content_type', $content_type); $this->db->from('ranking as a'); $this->db->join('news as b', 'a.content_idx=b.idx'); $this->db->limit($limit, $offset); $this->db->order_by('a.rank', 'asc'); $res = $this->db->get(); $row = $res->result_array(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : ranking life join # CREATE : 2018-04-29 #--------------------------------------------------------------------------- function ranking_join_life_list($req_data){ # request $offset = $req_data['offset']; $limit = $req_data['limit']; $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->select('a.*, b.partner_idx, b.content, b.editor_name, b.hit_count, b.comment_count, b.like_count, b.display_date'); $this->db->where('b.is_del', 'N'); $this->db->where('b.is_display', 'Y'); $this->db->where('a.is_del', 'N'); $this->db->where('a.ranking_type', $ranking_type); $this->db->where('a.content_type', $content_type); $this->db->from('ranking as a'); $this->db->join('life as b', 'a.content_idx=b.idx'); $this->db->limit($limit, $offset); $this->db->order_by('a.rank', 'asc'); $res = $this->db->get(); $row = $res->result_array(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : count # CREATE : 2018-04-28 #--------------------------------------------------------------------------- function ranking_join_news_total_count($req_data){ # request $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->where('a.is_del', 'N'); $this->db->where('b.is_del', 'N'); $this->db->where('b.is_display', 'Y'); $this->db->where('a.ranking_type', $ranking_type); $this->db->where('a.content_type', $content_type); $this->db->from('ranking as a'); $this->db->join('news as b', 'a.content_idx = b.idx'); $row = $this->db->count_all_results(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : count # CREATE : 2018-04-28 #--------------------------------------------------------------------------- function ranking_join_life_total_count($req_data){ # request $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->where('a.is_del', 'N'); $this->db->where('b.is_del', 'N'); $this->db->where('b.is_display', 'Y'); $this->db->where('a.ranking_type', $ranking_type); $this->db->where('a.content_type', $content_type); $this->db->from('ranking as a'); $this->db->join('life as b', 'a.content_idx = b.idx'); $row = $this->db->count_all_results(); return $row; } #--------------------------------------------------------------------------- # PURPOSE : count # CREATE : 2018-04-28 #--------------------------------------------------------------------------- function ranking_total_count($req_data){ # request $ranking_type = $req_data['ranking_type']; $content_type = $req_data['content_type']; $this->db->where('is_del', 'N'); $this->db->where('ranking_type', $ranking_type); $this->db->where('content_type', $content_type); $this->db->from('ranking'); $row = $this->db->count_all_results(); return $row; } } ?>