71 lines
1.8 KiB
PHP
Executable File
71 lines
1.8 KiB
PHP
Executable File
<?
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class m_spam extends CI_Model{
|
|
|
|
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
|
|
function __construct(){
|
|
parent::__construct();
|
|
|
|
$this->load->database();
|
|
$this->load->library('session');
|
|
}
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
# PURPOSE : insert
|
|
# CREATE : 2018-04-27
|
|
#---------------------------------------------------------------------------
|
|
function spam_insert($req_data){
|
|
|
|
$now_date = date("Y-m-d H:i:s");
|
|
$req_data['reg_date'] = $now_date;
|
|
|
|
$row = $this->db->insert('spam', $req_data);
|
|
return $row;
|
|
}
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
# PURPOSE : select
|
|
# CREATE : 2018-04-04
|
|
#---------------------------------------------------------------------------
|
|
function spam_where_comment_idx_count($comment_idx){
|
|
|
|
$this->db->where('comment_idx', $comment_idx);
|
|
$this->db->from('spam');
|
|
$row = $this->db->count_all_results();
|
|
|
|
return $row;
|
|
}
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
# PURPOSE : count
|
|
# CREATE : 2018-04-04
|
|
#---------------------------------------------------------------------------
|
|
function spam_where_member_id_comment_idx_count($req_data){
|
|
$comment_idx = $req_data['comment_idx'];
|
|
$member_id = $req_data['member_id'];
|
|
|
|
$this->db->where('write_id', $member_id);
|
|
$this->db->where('comment_idx', $comment_idx);
|
|
$this->db->from('spam');
|
|
$row = $this->db->count_all_results();
|
|
|
|
return $row;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
?>
|