From a1cf9ec11f24377cfc79981946d1cd912aeccb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 24 Mar 2025 16:29:42 +0900 Subject: [PATCH] cfmgrv4 init...10 --- app/Controllers/CommonController.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index d0efc68..8dc8421 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -511,7 +511,7 @@ abstract class CommonController extends BaseController $this->total_page = $pager->getPageCount($pager_group); return $pager->links($pager_group, $template); } - protected function index_process_orderBy(): void + protected function index_entitys_process_orderBy(): void { $this->order_field = $this->request->getVar('order_field') ?: DEFAULTS['EMPTY']; $this->order_value = $this->request->getVar('order_value') ?: DEFAULTS['EMPTY']; @@ -531,10 +531,21 @@ abstract class CommonController extends BaseController )); } } - protected function index_process_limit(): void + protected function index_entitys_process_limit(): void { $this->getService()->getModel()->limit($this->per_page, $this->page * $this->per_page - $this->per_page); } + protected function index_entitys_process(): array + { + $this->index_condition_process(); + //Sorting 처리 + $this->index_entitys_process_orderBy(); + //Limit관련 + $this->index_entitys_process_limit(); + $entitys = $this->getService()->getModel()->select($this->getService()->getModel()::TABLE . '.*')->findAll(); + // log_message("debug", $this->getService()->getModel()->getLastQuery()); + return $entitys; + } protected function index_process_result(): string { return view( @@ -553,13 +564,7 @@ abstract class CommonController extends BaseController //pagenation 처리 $this->pagination = $this->index_pagination_process(); //모델 처리 - $this->index_condition_process(); - //Sorting 처리 - $this->index_process_orderBy(); - //Limit관련 - $this->index_process_limit(); - $this->entitys = $this->getService()->getModel()->select($this->getService()->getModel()::TABLE . '.*')->findAll(); - // log_message("debug", $this->getService()->getModel()->getLastQuery()); + $this->entitys = $this->index_entitys_process(); // 현재 URL을 스택에 저장 $this->myauth->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : "")); return $this->index_process_result();