first commit

This commit is contained in:
pakerpale
2020-06-10 06:19:03 +09:00
commit cd6b5b7832
6081 changed files with 624389 additions and 0 deletions

View File

@@ -0,0 +1,233 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_blind extends CI_Model{
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : list
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_list($req_data){
# request
$offset = $req_data['offset'];
$limit = $req_data['limit'];
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_content_type = $req_data['search_content_type'];
$search_spam_reason = $req_data['search_spam_reason'];
$search_status = $req_data['search_status'];
$where_query = "";
if($search_type!='' && $search_keyword!=''){
$where_query.=" and AA.".$search_type." like '%".$search_keyword."%'";
}
if($search_content_type!='') $where_query.=" and AA.content_type = '".$search_content_type."'";
if($search_spam_reason!='') $where_query.=" and AA.reason_type like '%".$search_spam_reason."%'";
if($search_status!='') $where_query.=" and AA.blind_status = '".$search_status."'";
$sql="select *, (select count(*) from blind where is_del='N' and blind_id=AA.blind_id and blind_status = '2') as admin_spam_count, (select count(*) from spam where comment_idx=AA.comment_idx) as spam_count
from (select *, (select GROUP_CONCAT(DISTINCT reason_type ORDER BY reason_type DESC SEPARATOR ',') from spam where is_del='N' and comment_idx=blind.comment_idx) as reason_type
from blind
where is_del = 'N') as AA where 1 ".$where_query." order by AA.reg_date desc limit $offset, $limit ";
$res = $this->db->query($sql);
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : list - total count
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_list_total_count($req_data){
# request
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_content_type = $req_data['search_content_type'];
$search_spam_reason = $req_data['search_spam_reason'];
$search_status = $req_data['search_status'];
$where_query = "";
if($search_type!='' && $search_keyword!=''){
$where_query.=" and AA.".$search_type." like '%".$search_keyword."%'";
}
if($search_content_type!='') $where_query.=" and AA.content_type = '".$search_content_type."'";
if($search_spam_reason!='') $where_query.=" and AA.reason_type like '%".$search_spam_reason."%'";
if($search_status!='') $where_query.=" and AA.blind_status = '".$search_status."'";
$sql="select *
from (select *,
(select GROUP_CONCAT(DISTINCT reason_type ORDER BY reason_type DESC SEPARATOR ',') from spam where is_del='N' and comment_idx=blind.comment_idx) as reason_type
from blind
where is_del = 'N') as AA where 1 ".$where_query;
$res = $this->db->query($sql);
$row = $res->num_rows();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : update
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_update($req_data){
# request
$idx = $req_data['idx'];
unset($req_data['idx']);
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$req_data['update_id'] = $user_id;
$req_data['update_date'] = $now_date;
$this->db->where('idx', $idx);
$row = $this->db->update('blind', $req_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_join_comment_select($req_data){
# request
$idx = $req_data;
$this->db->select('a.*, b.reg_date as write_date');
$this->db->where('a.idx', $idx);
$this->db->where('a.is_del', 'N');
$this->db->from('blind as a');
$this->db->join('comment as b', 'a.comment_idx=b.idx');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : status group by count
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_list_status_group_by_count(){
$this->db->select('blind_status, count(blind_status) as cnt');
$this->db->where('is_del', 'N');
$this->db->group_by("blind_status");
$this->db->from('blind');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : comment status count
# CREATE : 2018-04-13
#---------------------------------------------------------------------------
function blind_list_join_comment_status_count($comment_status){
$this->db->where('a.is_del', 'N');
$this->db->where('b.comment_status', $comment_status);
$this->db->from('blind as a');
$this->db->join('comment as b', 'a.comment_idx=b.idx');
$res = $this->db->get();
$row = $res->num_rows();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 랭킹 insert
# CREATE : 2018-03-06
#---------------------------------------------------------------------------
function blind_insert($req_data){
$row = $this->db->insert('blind', $req_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-04-27
#---------------------------------------------------------------------------
function blind_select($idx){
# request
$this->db->where('idx', $idx);
$this->db->from('blind');
$res = $this->db->get();
$row = $res->row_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-04-27
#---------------------------------------------------------------------------
function blind_group_by_count_list($req_data){
# request
$cnt = $req_data['cnt'];
$sql="select blind_id, count(*) as cnt
from blind
where blind_status = '2'
and limit_count < '".$cnt."'
and is_del = 'N'
group by blind_id having count(*) >= ".$cnt;
$res = $this->db->query($sql);
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : update
# CREATE : 2018-04-27
#---------------------------------------------------------------------------
function blind_group_by_count_update($req_data){
# request
$member_id = $req_data['member_id'];
$limit_count = $req_data['cnt'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_date['update_id'] = $user_id;
$update_date['update_date'] = $now_date;
$update_date['limit_count'] = $limit_count;
$this->db->where('blind_id', $member_id);
$row = $this->db->update('blind', $update_date);
return $row;
}
}
?>

View File

@@ -0,0 +1,222 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_blind_limit extends CI_Model{
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : list
# CREATE : 2018-03-28
#---------------------------------------------------------------------------
function blind_limit_list($req_data){
# request
$offset = $req_data['offset'];
$limit = $req_data['limit'];
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_limit_type = $req_data['search_limit_type'];
$search_status = $req_data['search_status'];
$search_is_today = $req_data['search_is_today'];
if($search_type!='' && $search_keyword!=''){
$this->db->where("(a.member_id LIKE '%".$search_keyword."%' OR a.member_name LIKE '%".$search_keyword."%')");
}
if($search_limit_type!='') $this->db->where('a.limit_type', $search_limit_type);
if($search_status!='') $this->db->where('a.limit_status', $search_status);
if($search_is_today=='Y') $this->db->where('a.reg_date >= ', date("Y-m-d")."00:00:00");
$this->db->select('a.*, (select count(*) from blind_limit where is_del="N" and member_id=a.member_id) as limit_sum_count');
$this->db->where('a.is_del', 'N');
$this->db->from('blind_limit as a');
$this->db->limit($limit, $offset);
$this->db->order_by('a.reg_date', 'desc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : list - total count
# CREATE : 2018-03-30
#----------------------------------------------------------------------------
function blind_limit_list_total_count($req_data){
# request
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_limit_type = $req_data['search_limit_type'];
$search_status = $req_data['search_status'];
$search_is_today = $req_data['search_is_today'];
if($search_type!='' && $search_keyword!=''){
$this->db->where("(member_id LIKE '%".$search_keyword."%' OR member_name LIKE '%".$search_keyword."%')");
}
if($search_limit_type!='') $this->db->where('limit_type', $search_limit_type);
if($search_status!='') $this->db->where('limit_status', $search_status);
if($search_is_today=='Y') $this->db->where('reg_date >= ', date("Y-m-d")."00:00:00");
$this->db->where('is_del', 'N');
$this->db->from('blind_limit');
$row = $this->db->count_all_results();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : new count
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_new_count($req_data){
# request
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_limit_type = $req_data['search_limit_type'];
$search_status = $req_data['search_status'];
$now_date = date("Y-m-d")." 00:00:00";
if($search_type!='' && $search_keyword!=''){
$this->db->where("(member_id LIKE '%".$search_keyword."%' OR member_name LIKE '%".$search_keyword."%')");
}
if($search_limit_type!='') $this->db->where('limit_type', $search_limit_type);
if($search_status!='') $this->db->where('limit_status', $search_status);
$this->db->where('is_del', 'N');
$this->db->where('reg_date >=', $now_date);
$this->db->from('blind_limit');
$row = $this->db->count_all_results();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : status group by count
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_status_group_by_count($req_data){
# request
$search_type = $req_data['search_type'];
$search_keyword = $req_data['search_keyword'];
$search_limit_type = $req_data['search_limit_type'];
$search_status = $req_data['search_status'];
$search_is_today = $req_data['search_is_today'];
if($search_type!='' && $search_keyword!=''){
$this->db->where("(member_id LIKE '%".$search_keyword."%' OR member_name LIKE '%".$search_keyword."%')");
}
if($search_limit_type!='') $this->db->where('limit_type', $search_limit_type);
if($search_status!='') $this->db->where('limit_status', $search_status);
if($search_is_today=='Y') $this->db->where('reg_date >= ', date("Y-m-d")."00:00:00");
$this->db->select('limit_status, count(limit_status) as cnt');
$this->db->where('is_del', 'N');
$this->db->group_by("limit_status");
$this->db->from('blind_limit');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : insert
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_insert($req_data){
$user_id = $this->session->userdata('Adm_Id');
if($user_id=='') $user_id = $req_data['reg_id'];
$now_date = date("Y-m-d H:i:s");
$req_data['reg_id'] = $user_id;
$req_data['reg_date'] = $now_date;
$req_data['update_id'] = $user_id;
$req_data['update_date']= $now_date;
$row = $this->db->insert('blind_limit', $req_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_select($req_data){
# request
$idx = $req_data;
$this->db->where('idx', $idx);
$this->db->where('is_del', 'N');
$this->db->from('blind_limit');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : update
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_update($req_data){
# request
$idx = $req_data['idx'];
unset($req_data['idx']);
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$req_data['update_id'] = $user_id;
$req_data['update_date'] = $now_date;
$this->db->where('idx', $idx);
$row = $this->db->update('blind_limit', $req_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : is_del update
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_limit_is_del_update($req_data){
# request
$idx = $req_data;
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('is_del' => 'Y',
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('idx', $idx);
$row = $this->db->update('blind_limit', $update_data);
return $row;
}
}
?>

View File

@@ -0,0 +1,76 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_blind_setting extends CI_Model{
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : list
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_setting_list(){
$this->db->from('blind_setting');
$this->db->order_by('limit_count', 'desc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : update
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_setting_update($req_data){
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
foreach($req_data as $key=>$val) {
$req_data[$key]['update_id'] = $user_id;
$req_data[$key]['update_date'] = $now_date;
}
$this->db->update_batch('blind_setting', $req_data, 'idx');
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-03-30
#---------------------------------------------------------------------------
function blind_setting_select($idx){
$this->db->where('idx', $idx);
$this->db->from('blind_setting');
$res = $this->db->get();
$row = $res->row_array();
return $row;
}
}
?>

View File

@@ -0,0 +1,117 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_comment_setting extends CI_Model{
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : comment_setting select
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function comment_setting_select($req_data){
# request
$setting_type = $req_data['setting_type'];
$this->db->where('setting_type', $setting_type);
$this->db->from('comment_setting');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : comment_setting update
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function comment_setting_update($req_data){
# request
$setting_type = $req_data['setting_type'];
$best_comment_like_count = $req_data['best_comment_like_count'];
$max_best_comment_count = $req_data['max_best_comment_count'];
$block_call_count = $req_data['block_call_count'];
$block_call_type = $req_data['block_call_type'];
$block_blind_conent = $req_data['block_blind_conent'];
$block_del_conent = $req_data['block_del_conent'];
$self_del_contnet = $req_data['self_del_contnet'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('best_comment_like_count' => $best_comment_like_count,
'max_best_comment_count' => $max_best_comment_count,
'block_call_count' => $block_call_count,
'block_call_type' => $block_call_type,
'block_blind_conent' => $block_blind_conent,
'block_del_conent' => $block_del_conent,
'self_del_contnet' => $self_del_contnet,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('setting_type', $setting_type);
$row = $this->db->update('comment_setting', $update_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : comment_setting list
# CREATE : 2018-03-13
#---------------------------------------------------------------------------
function comment_setting_list(){
$this->db->from('comment_setting');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-04-11
#---------------------------------------------------------------------------
function contents_setting_select($idx){
$this->db->where('idx', $idx);
$this->db->from('contents_setting');
$res = $this->db->get();
$row = $res->row_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : select
# CREATE : 2018-05-10
#---------------------------------------------------------------------------
function comment_setting_where_content_idx_select($content_idx){
$this->db->where('setting_type', $content_idx);
$this->db->from('comment_setting');
$res = $this->db->get();
$row = $res->row_array();
return $row;
}
}
?>

View File

@@ -0,0 +1,329 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_realtime_keyword extends CI_Model{
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 - list
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_list(){
$this->db->where('is_del', 'N');
$this->db->from('realtime_keyword');
$this->db->order_by('rank asc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 - list where search count
# CREATE : 2018-02-28
#---------------------------------------------------------------------------
function realtime_keyword_list_where_search_count($req_data){
# request
$search_count = $req_data;
$this->db->where('is_del', 'N');
$this->db->where('search_count <=', $search_count);
$this->db->from('realtime_keyword');
$this->db->order_by('rank asc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 - list where search count 위에 순위
# CREATE : 2018-02-28
#---------------------------------------------------------------------------
function realtime_keyword_list_where_over_search_count($req_data){
# request
$search_count = $req_data;
$this->db->where('is_del', 'N');
$this->db->where('search_count >', $search_count);
$this->db->from('realtime_keyword');
$this->db->order_by('rank desc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 insert
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_insert($req_data){
# request
$rank = $req_data['rank'];
$keyword = $req_data['keyword'];
$search_count = $req_data['search_count'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$insert_data = array('rank' => $rank,
'keyword' => $keyword,
'search_count' => $search_count,
'reg_id' => $user_id,
'reg_date' => $now_date,
'update_id' => $user_id,
'update_date' => $now_date
);
$row = $this->db->insert('realtime_keyword', $insert_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 - realtime_keyword.is_del update
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_is_del_update($req_data){
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$arr_update_data = array();
foreach($req_data as $key=>$val) {
$arr_update_data[$key]['idx'] = $val;
$arr_update_data[$key]['is_del'] = 'Y';
$arr_update_data[$key]['update_id'] = $user_id;
$arr_update_data[$key]['update_date'] = $now_date;
}
$this->db->update_batch('realtime_keyword', $arr_update_data, 'idx');
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 update
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_update($req_data){
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
foreach($req_data as $key=>$val) {
$req_data[$key]['update_id'] = $user_id;
$req_data[$key]['update_date'] = $now_date;
}
$row = $this->db->update_batch('realtime_keyword', $req_data, 'idx');
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 셋팅 - select
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_setting_select($req_data){
# request
$idx = $req_data;
$this->db->where('idx', $idx);
$this->db->from('realtime_keyword_setting');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 select
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_where_keyword_select($keyword){
$this->db->where('keyword', $keyword);
$this->db->from('realtime_keyword');
$res = $this->db->get();
$row = $res->row_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 셋팅 - update
# CREATE : 2018-02-23
#---------------------------------------------------------------------------
function realtime_keyword_setting_update($req_data){
# request
$idx = $req_data['idx'];
$base_hour = $req_data['base_hour'];
$delete_hour = $req_data['delete_hour'];
$is_no_result_keyword = $req_data['is_no_result_keyword'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('base_hour' => $base_hour,
'delete_hour' => $delete_hour,
'is_no_result_keyword' => $is_no_result_keyword,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('idx', $idx);
$row = $this->db->update('realtime_keyword_setting', $update_data);
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 log - list
# CREATE : 2018-02-28
#---------------------------------------------------------------------------
function realtime_keyword_log_list($req_data){
# request
$start_date = $req_data['start_date'];
$end_date = $req_data['end_date'];
$offset = $req_data['offset'];
$limit = $req_data['limit'];
$this->db->where('base_date >=', $start_date);
$this->db->where('base_date <=', $end_date);
$this->db->where('is_del', 'N');
$this->db->from('realtime_keyword_log');
$this->db->order_by('reg_date desc, rank asc');
$this->db->limit($limit, $offset);
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 log list - total count
# CREATE : 2018-02-28
#---------------------------------------------------------------------------
function realtime_keyword_log_list_total_count($req_data){
# request
$start_date = $req_data['start_date'];
$end_date = $req_data['end_date'];
$this->db->where('base_date >=', $start_date);
$this->db->where('base_date <=', $end_date);
$this->db->where('is_del', 'N');
$this->db->from('realtime_keyword_log');
$row = $this->db->count_all_results();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 log - all list
# CREATE : 2018-02-28
#---------------------------------------------------------------------------
function realtime_keyword_log_all_list($req_data){
# request
$start_date = $req_data['start_date'];
$end_date = $req_data['end_date'];
$this->db->where('base_date >=', $start_date);
$this->db->where('base_date <=', $end_date);
$this->db->where('is_del', 'N');
$this->db->from('realtime_keyword_log');
$this->db->order_by('reg_date desc, rank asc');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 실시간검색어 select max reg_date
# CREATE : 2018-03-27
#---------------------------------------------------------------------------
function realtime_keyword_max_reg_date(){
$this->db->select('max(reg_date) as reg_date');
$this->db->where('is_del', 'N');
$this->db->from('realtime_keyword');
$res = $this->db->get();
$row = $res->result_array();
return $row;
}
#---------------------------------------------------------------------------
# PURPOSE : 로그로 이동
# CREATE : 2018-03-27
#---------------------------------------------------------------------------
function realtime_keyword_move_log(){
$now_date = date("Y-m-d H:i:s");
$sql = "INSERT INTO realtime_keyword_log (base_date, rank, last_rank, keyword, search_count, reg_id, reg_date, update_id, update_date, is_del)
SELECT reg_date, rank, last_rank, keyword, search_count, reg_id, reg_date, update_id, update_date, is_del
FROM realtime_keyword";
$this->db->query($sql);
}
#---------------------------------------------------------------------------
# PURPOSE : delete
# CREATE : 2018-04-17
#---------------------------------------------------------------------------
function realtime_keyword_where_reg_date_delete($reg_date){
$this->db->where('reg_date <', $reg_date);
$row = $this->db->delete('realtime_keyword');
return $row;
}
}
?>

View File

@@ -0,0 +1,248 @@
<?
defined('BASEPATH') OR exit('No direct script access allowed');
class m_setting_site extends CI_Model{
function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('session');
}
#---------------------------------------------------------------------------
# PURPOSE : site_info select
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function site_info_select(){
$sql1 = "select * from site_info where idx = 1";
$res1 = $this->db->query($sql1);
$row1 = $res1->row();
$array = json_decode(json_encode($row1), true);
return $array;
}
#---------------------------------------------------------------------------
# PURPOSE : site_info insert
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function site_info_insert($req_data){
# request
$homepage_title = $req_data['homepage_title'];
$footer_script = $req_data['footer_script'];
$webmaster_name = $req_data['webmaster_name'];
$webmaster_email = $req_data['webmaster_email'];
$admin_logo = $req_data['admin_logo'];
$footer_content = $req_data['footer_content'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$insert_data = array('idx' => 1,
'homepage_title' => $homepage_title,
'footer_script' => $footer_script,
'webmaster_name' => $webmaster_name,
'webmaster_email' => $webmaster_email,
'admin_logo' => $admin_logo,
'footer_content' => $footer_content,
'reg_date' => $now_date,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->insert('site_info', $insert_data);
}
#---------------------------------------------------------------------------
# PURPOSE : site_info update
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function site_info_update($req_data){
# request
$idx = $req_data['idx'];
$homepage_title = $req_data['homepage_title'];
$footer_script = $req_data['footer_script'];
$webmaster_name = $req_data['webmaster_name'];
$webmaster_email = $req_data['webmaster_email'];
$admin_logo = $req_data['admin_logo'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('homepage_title' => $homepage_title,
'footer_script' => $footer_script,
'webmaster_name' => $webmaster_name,
'webmaster_email' => $webmaster_email,
'admin_logo' => $admin_logo,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('idx', $idx);
$this->db->update('site_info', $update_data);
}
#---------------------------------------------------------------------------
# PURPOSE : site_info.footer_content update
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function site_info_footer_content_update($req_data){
# request
$idx = $req_data['idx'];
$footer_content = $req_data['footer_content'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('footer_content' => $footer_content,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('idx', $idx);
$this->db->update('site_info', $update_data);
}
#---------------------------------------------------------------------------
# PURPOSE : site_info.service, privacy, privacy_agreement update
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function site_info_policy_update($req_data){
# request
$idx = $req_data['idx'];
$service = $req_data['service'];
$privacy = $req_data['privacy'];
$privacy_agreement = $req_data['privacy_agreement'];
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$update_data = array('service' => $service,
'privacy' => $privacy,
'privacy_agreement' => $privacy_agreement,
'update_id' => $user_id,
'update_date' => $now_date
);
$this->db->where('idx', $idx);
$this->db->update('site_info', $update_data);
}
#---------------------------------------------------------------------------
# PURPOSE : 금칙어 select
# CREATE : 2018-02-19
#---------------------------------------------------------------------------
function forbidden_word_select(){
$sql1 = "select * from forbidden_word order by idx asc";
$res1 = $this->db->query($sql1);
$row1 = $res1->result_array();
return $row1;
}
#---------------------------------------------------------------------------
# PURPOSE : 금칙어 truncate
# CREATE : 2018-02-20
#---------------------------------------------------------------------------
function forbidden_word_delete(){
$this->db->truncate('forbidden_word');
}
#---------------------------------------------------------------------------
# PURPOSE : 금칙어 insert
# CREATE : 2018-02-20
#---------------------------------------------------------------------------
function forbidden_word_insert($req_data){
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$i = 0;
$arr_word = array();
foreach($req_data as $val) {
$arr_word[$i]['word'] = $val;
$arr_word[$i]['reg_id'] = $user_id;
$arr_word[$i]['reg_date'] = $now_date;
$i++;
}
$this->db->insert_batch('forbidden_word', $arr_word);
}
#---------------------------------------------------------------------------
# PURPOSE : 접근권한 select
# CREATE : 2018-02-20
#---------------------------------------------------------------------------
function site_access_ip_select(){
$sql1 = "select * from site_access_ip order by idx asc";
$res1 = $this->db->query($sql1);
$row1 = $res1->result_array();
return $row1;
}
#---------------------------------------------------------------------------
# PURPOSE : 접근권한 truncate
# CREATE : 2018-02-20
#---------------------------------------------------------------------------
function site_access_ip_delete(){
$this->db->truncate('site_access_ip');
}
#---------------------------------------------------------------------------
# PURPOSE : 접근권한 insert
# CREATE : 2018-02-20
#---------------------------------------------------------------------------
function site_access_ip_insert($req_data){
$user_id = $this->session->userdata('Adm_Id');
$now_date = date("Y-m-d H:i:s");
$i = 0;
$arr_access_ip = array();
foreach ($req_data['access_type_1'] as $val1){
$arr_access_ip[$i]['access_type'] = 1;
$arr_access_ip[$i]['ip'] = $val1;
$arr_access_ip[$i]['reg_id'] = $user_id;
$arr_access_ip[$i]['reg_date'] = $now_date;
$i++;
}
foreach ($req_data['access_type_2'] as $val2){
$arr_access_ip[$i]['access_type'] = 2;
$arr_access_ip[$i]['ip'] = $val2;
$arr_access_ip[$i]['reg_id'] = $user_id;
$arr_access_ip[$i]['reg_date'] = $now_date;
$i++;
}
foreach ($req_data['access_type_3'] as $val3){
$arr_access_ip[$i]['access_type'] = 3;
$arr_access_ip[$i]['ip'] = $val3;
$arr_access_ip[$i]['reg_id'] = $user_id;
$arr_access_ip[$i]['reg_date'] = $now_date;
$i++;
}
$this->db->insert_batch('site_access_ip', $arr_access_ip);
}
}
?>