first commit
This commit is contained in:
78
application/models/web/m_category.php
Executable file
78
application/models/web/m_category.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class m_category extends CI_Model{
|
||||
|
||||
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->database();
|
||||
$this->load->library('session');
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : list
|
||||
# CREATE : 2018-04-30
|
||||
#---------------------------------------------------------------------------
|
||||
function category_all_list(){
|
||||
|
||||
$this->db->where('is_del', 'N');
|
||||
$this->db->from('category');
|
||||
$this->db->order_by('display_sort', 'asc');
|
||||
$this->db->order_by('reg_date', 'desc');
|
||||
$res = $this->db->get();
|
||||
$row = $res->result_array();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : list - total count
|
||||
# CREATE : 2018-04-30
|
||||
#---------------------------------------------------------------------------
|
||||
function category_list_total_count(){
|
||||
|
||||
$this->db->where('is_del', 'N');
|
||||
$this->db->from('category');
|
||||
$row = $this->db->count_all_results();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : select
|
||||
# CREATE : 2018-04-30
|
||||
#---------------------------------------------------------------------------
|
||||
function category_select($idx){
|
||||
|
||||
$this->db->where('is_del', 'N');
|
||||
$this->db->where('idx', $idx);
|
||||
$this->db->from('category');
|
||||
$res = $this->db->get();
|
||||
$row = $res->row_array();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user