45 lines
1.2 KiB
PHP
Executable File
45 lines
1.2 KiB
PHP
Executable File
<?
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class m_search_keyword_log extends CI_Model{
|
|
|
|
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
|
|
function __construct(){
|
|
parent::__construct();
|
|
|
|
$this->load->database();
|
|
$this->load->library('session');
|
|
}
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
# PURPOSE : search_keyword_log - group by keyword
|
|
# CREATE : 2018-03-27
|
|
#---------------------------------------------------------------------------
|
|
function search_keyword_log_group_by_keyword($req_data){
|
|
# request
|
|
$start_date = $req_data['start_date'];
|
|
$end_date = $req_data['end_date'];
|
|
|
|
$this->db->select('keyword, count(*) as cnt');
|
|
$this->db->where('reg_date >=', $start_date);
|
|
$this->db->where('reg_date <=', $end_date);
|
|
$this->db->from('search_keyword_log');
|
|
$this->db->group_by('keyword');
|
|
$this->db->order_by('count(*)', 'desc');
|
|
$this->db->limit(20, 0);
|
|
$res = $this->db->get();
|
|
$row = $res->result_array();
|
|
|
|
return $row;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
?>
|