diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php
index 4539ff0..0bc4aba 100644
--- a/app/Controllers/CommonController.php
+++ b/app/Controllers/CommonController.php
@@ -658,8 +658,8 @@ abstract class CommonController extends BaseController
{
//조건절 처리
$this->setConditionForList();
- //TotalCount
- $this->total_count = intval($this->getService()->getModel()->selectCount('*', 'cnt')->get()->getRow()->cnt);
+ //TotalCount (SoftDelete적용이 되려면 countAllResults를 사용해야함)
+ $this->total_count = $this->getService()->getModel()->selectCount('*', 'cnt')->countAllResults();
//Pagination 처리
$this->pagination = $this->getPaginationForList();
//줄수 처리용
@@ -684,9 +684,6 @@ abstract class CommonController extends BaseController
// 현재 URL을 스택에 저장
helper(['form']);
$this->entities = $this->index_process();
- if (env('app.debug.index')) {
- echo $this->getService()->getModel()->getLastQuery() . "
";
- }
return $this->getResultSuccess();
} catch (\Exception $e) {
return $e->getMessage();
diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php
index 29d0716..56b72c0 100644
--- a/app/Services/CommonService.php
+++ b/app/Services/CommonService.php
@@ -87,6 +87,9 @@ abstract class CommonService
foreach ($this->findAllDatas($columns) as $entity) {
$entities[$entity->getPK()] = $entity;
}
+ if (env('app.debug.index')) {
+ echo $this->getModel()->getLastQuery() . "
";
+ }
return $entities;
} //
//기본 기능부분