cfmgrv4 init...10

This commit is contained in:
최준흠 2025-03-24 16:29:42 +09:00
parent 5f6e6c7aaf
commit a1cf9ec11f

View File

@ -511,7 +511,7 @@ abstract class CommonController extends BaseController
$this->total_page = $pager->getPageCount($pager_group); $this->total_page = $pager->getPageCount($pager_group);
return $pager->links($pager_group, $template); 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_field = $this->request->getVar('order_field') ?: DEFAULTS['EMPTY'];
$this->order_value = $this->request->getVar('order_value') ?: 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); $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 protected function index_process_result(): string
{ {
return view( return view(
@ -553,13 +564,7 @@ abstract class CommonController extends BaseController
//pagenation 처리 //pagenation 처리
$this->pagination = $this->index_pagination_process(); $this->pagination = $this->index_pagination_process();
//모델 처리 //모델 처리
$this->index_condition_process(); $this->entitys = $this->index_entitys_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());
// 현재 URL을 스택에 저장 // 현재 URL을 스택에 저장
$this->myauth->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : "")); $this->myauth->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
return $this->index_process_result(); return $this->index_process_result();