This commit is contained in:
@@ -9,6 +9,8 @@ use App\Models\listfax\ListFaxModel;
|
||||
class ListFax extends BaseController
|
||||
{
|
||||
|
||||
private $listfaxModel;
|
||||
|
||||
private $todo = ''; // 검색, 엑셀다운 구분
|
||||
private $menuid = ''; // 레프트메뉴아이디
|
||||
|
||||
@@ -38,6 +40,10 @@ class ListFax extends BaseController
|
||||
|
||||
private $pars = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->listfaxModel = new ListFaxModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
@@ -133,8 +139,7 @@ class ListFax extends BaseController
|
||||
// CI3: $base_uri = '/listfax/listfax/lists';
|
||||
$base_uri = '/listfax/listfax/lists';
|
||||
|
||||
// CI3: $this->load->model('v2/listfax_model', 'listfax_model');
|
||||
$listfaxModel = new ListFaxModel();
|
||||
// CI3: $this->load->model('v2/listfax_model', 'listfax_model');
|
||||
|
||||
// CI3: $this->load->helper('array_helper');
|
||||
helper(filenames: 'array'); // array_helper => array 로 이름 바꿨다면 이렇게
|
||||
@@ -149,7 +154,7 @@ class ListFax extends BaseController
|
||||
'total' => 0,
|
||||
];
|
||||
} else {
|
||||
$resultData = $listfaxModel->getLists(
|
||||
$resultData = $this->listfaxModel->getLists(
|
||||
$this->todo,
|
||||
$this->page,
|
||||
$this->pagesize,
|
||||
@@ -185,4 +190,26 @@ class ListFax extends BaseController
|
||||
return view('listfax/listfax/lists', $data);
|
||||
}
|
||||
|
||||
|
||||
public function getLists()
|
||||
{
|
||||
$start = (int) $this->request->getGet('start') ?: 0;
|
||||
$end = (int) $this->request->getGet('length') ?: 10;
|
||||
|
||||
|
||||
$data = [
|
||||
'caller_no' => $this->request->getGet('caller_no'),
|
||||
];
|
||||
|
||||
$totalCount = $this->listfaxModel->getTotalCount($data);
|
||||
|
||||
$datas = $this->listfaxModel->getResultList($start, $end, $data);
|
||||
|
||||
return $this->response->setJSON(body: [
|
||||
'recordsTotal' => $totalCount,
|
||||
'recordsFiltered' => $totalCount,
|
||||
'data' => $datas,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user