Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
56
application/models/Apps_model.php
Normal file
56
application/models/Apps_model.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Apps model class
|
||||
*/
|
||||
|
||||
class Apps_model extends MY_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* 테이블명
|
||||
*/
|
||||
public $_table = 'apps';
|
||||
|
||||
/**
|
||||
* 사용되는 테이블의 프라이머리키
|
||||
*/
|
||||
public $primary_key = 'app_id'; // 사용되는 테이블의 프라이머리키
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function get_admin_list($limit = '', $offset = '', $where = '', $like = '', $findex = '', $forder = '', $sfield = '', $skeyword = '', $sop = 'OR')
|
||||
{
|
||||
$result = $this->_get_list_common('', '', $limit, $offset, $where, $like, $findex, $forder, $sfield, $skeyword, $sop);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function select_max_sort()
|
||||
{
|
||||
$this->db->select_max('app_sort');
|
||||
$qry = $this->db->get($this->_table);
|
||||
$result = $qry->row_array();
|
||||
return $result['app_sort'];
|
||||
}
|
||||
|
||||
public function app_list()
|
||||
{
|
||||
$this->db->order_by('app_sort', 'desc');
|
||||
$qry = $this->db->get($this->_table);
|
||||
$result = $qry->result_array();
|
||||
$data = array();
|
||||
if ($result) {
|
||||
foreach ($result as $value) {
|
||||
$data[element('app_id', $value)] = $value;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user