From 101e6b0c75e2484ae02714afbc8d39cde402a525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Wed, 15 May 2024 18:02:07 +0900 Subject: [PATCH] vhost init...3 --- app/Controllers/BaseController.php | 18 ++++++------ app/Controllers/Front/BoardController.php | 6 ++-- app/Controllers/Front/OrderController.php | 4 +-- app/Controllers/Front/ProductController.php | 4 +-- app/Controllers/Front/SitepageController.php | 6 ++-- app/Controllers/Front/UserController.php | 4 +-- app/Language/ko/Device.php | 2 +- app/Models/BaseModel.php | 8 ++---- app/Views/admin/billing/index.php | 1 + app/Views/admin/board/index.php | 1 + app/Views/admin/category/index.php | 2 ++ app/Views/admin/device/index.php | 2 ++ app/Views/admin/order/index.php | 2 ++ app/Views/admin/product/index.php | 2 ++ app/Views/admin/sitepage/index.php | 2 ++ app/Views/admin/user/index.php | 2 ++ app/Views/admin/usersns/index.php | 2 ++ app/Views/templates/admin/index_head.php | 29 ++++++++------------ 18 files changed, 51 insertions(+), 46 deletions(-) diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index b97bcd2..e10df01 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -528,12 +528,12 @@ abstract class BaseController extends Controller { $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []]; } - protected function index_setCondition() + protected function index_condition() { //조건절 처리 $filterFields = array(); foreach ($this->_viewDatas['fieldFilters'] as $field) { - if (!is_null($this->request->getVar($field))) { + if ($this->request->getVar($field) != DEFAULTS['EMPTY']) { $filterFields[$field] = $this->request->getVar($field); } } @@ -551,7 +551,7 @@ abstract class BaseController extends Controller $this->_viewDatas['order_value'] ); } - private function index_getPagination($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): string + private function index_pagination($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): string { // 1.Views/Pagers/에 bootstrap_full.php,bootstrap_simple.php 생성 // 2.app/Config/Pager.php/$templates에 'bootstrap_full => 'Pagers\bootstrap_full', @@ -570,9 +570,9 @@ abstract class BaseController extends Controller $this->_viewDatas['total_page'] = $pager->getPageCount($pager_group); return $pager->links($pager_group, $template); } - private function index_getEntitys(): array + private function index_entitys(): array { - $this->index_setCondition(); + $this->index_condition(); if (array_key_exists('page', $this->_viewDatas)) { return $this->_model->findAll( $this->_viewDatas['per_page'], @@ -590,7 +590,7 @@ abstract class BaseController extends Controller } $this->index_process(); //Totalcount 처리 - $this->index_setCondition(); + $this->index_condition(); $this->_viewDatas['total_count'] = $this->_model->countAllResults(); // echo $this->_model->getLastQuery(); // echo "
"; @@ -605,9 +605,9 @@ abstract class BaseController extends Controller $this->_viewDatas['pageOptions'][$i] = $i; } //pagenation 처리 - $this->_viewDatas['pagination'] = $this->index_getPagination(); + $this->_viewDatas['pagination'] = $this->index_pagination(); //모델 처리 - $this->_viewDatas['entitys'] = $this->index_getEntitys(); + $this->_viewDatas['entitys'] = $this->index_entitys(); // echo $this->_model->getLastQuery(); // exit; // log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery()); @@ -647,7 +647,7 @@ abstract class BaseController extends Controller { try { $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); - $this->_viewDatas['Entitys'] = $this->index_getEntitys(); + $this->_viewDatas['Entitys'] = $this->index_entitys(); $html = view( $this->_viewPath . '/excel', ['viewDatas' => $this->_viewDatas] diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index cfd2552..f986603 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -117,11 +117,11 @@ class BoardController extends FrontController parent::index_process(); } //Category 및 Status 조건추가 - protected function index_setCondition() + protected function index_condition() { - $this->_model->where("category_uid", $this->_viewDatas['currentCategory']->getPrimaryKey()); + $this->_model->where("category", $this->_viewDatas['currentCategory']->getPrimaryKey()); $this->_model->where("status", DEFAULTS['STATUS']); - parent::index_setCondition(); + parent::index_condition(); } //Download관련 public function download_process($field, $entity) diff --git a/app/Controllers/Front/OrderController.php b/app/Controllers/Front/OrderController.php index 5f55986..43f9450 100644 --- a/app/Controllers/Front/OrderController.php +++ b/app/Controllers/Front/OrderController.php @@ -178,7 +178,7 @@ class OrderController extends FrontController $this->setCategory($this->request->getVar('category') ?: self::DEFAULT_CATEGORY); parent::index_process(); } - protected function index_setCondition() + protected function index_condition() { //세션에 Cart정보(order_uids)가 있으면 $uids = $this->_session->get(SESSION_NAMES['CART']) ?: array('NONE'); @@ -191,6 +191,6 @@ class OrderController extends FrontController } elseif (count($uids)) { $this->_model->whereIn('uid', $uids); } - parent::index_setCondition(); + parent::index_condition(); } } diff --git a/app/Controllers/Front/ProductController.php b/app/Controllers/Front/ProductController.php index e2f7eb8..8174464 100644 --- a/app/Controllers/Front/ProductController.php +++ b/app/Controllers/Front/ProductController.php @@ -66,10 +66,10 @@ class ProductController extends FrontController return parent::index_process(); } //Category 및 Status 조건추가 - protected function index_setCondition() + protected function index_condition() { $this->_model->where("category_uid", $this->_viewDatas['currentCategory']->getPrimaryKey()); $this->_model->where("status", DEFAULTS['STATUS']); - parent::index_setCondition(); + parent::index_condition(); } } diff --git a/app/Controllers/Front/SitepageController.php b/app/Controllers/Front/SitepageController.php index 214559e..d01ee4e 100644 --- a/app/Controllers/Front/SitepageController.php +++ b/app/Controllers/Front/SitepageController.php @@ -54,10 +54,10 @@ class SitepageController extends FrontController return parent::index_process(); } //Category 및 Status 조건추가 - protected function index_setCondition() + protected function index_condition() { - $this->_model->where("category_uid", $this->_viewDatas['currentCategory']->getPrimaryKey()); + $this->_model->where("category", $this->_viewDatas['currentCategory']->getPrimaryKey()); $this->_model->where("status", DEFAULTS['STATUS']); - parent::index_setCondition(); + parent::index_condition(); } } diff --git a/app/Controllers/Front/UserController.php b/app/Controllers/Front/UserController.php index cf4fba9..72956fd 100644 --- a/app/Controllers/Front/UserController.php +++ b/app/Controllers/Front/UserController.php @@ -115,10 +115,10 @@ class UserController extends FrontController parent::index_process(); } //사용자 UID 조건추가 - protected function index_setCondition() + protected function index_condition() { $this->_model->where("uid", $this->_viewDatas['auth'][AUTH_FIELDS['ID']]); - parent::index_setCondition(); + parent::index_condition(); } //추가기능 diff --git a/app/Language/ko/Device.php b/app/Language/ko/Device.php index 3c61853..ad02782 100644 --- a/app/Language/ko/Device.php +++ b/app/Language/ko/Device.php @@ -15,7 +15,7 @@ return [ 'created_at' => "생성일" ], "TYPE" => [ - 'beremetal' => '실서버', + 'beremetal' => '단독서버', 'kvm' => '가상서버', 'container' => '콘테이너', 'cpu' => 'CPU', diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index 9a4c4fc..6125a79 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -289,12 +289,8 @@ abstract class BaseModel extends Model foreach ($filterFields as $field => $value) { $this->where($field, $value); } - if (!is_null($word)) { - $this->setIndexWordFilter($word); - } - if (!is_null($start) && !is_null($end)) { - $this->setIndexDateFilter($start, $end); - } + $this->setIndexWordFilter($word); + $this->setIndexDateFilter($start, $end); $this->setIndexOrderBy($order_field, $order_value); } } diff --git a/app/Views/admin/billing/index.php b/app/Views/admin/billing/index.php index feb021e..51369c7 100644 --- a/app/Views/admin/billing/index.php +++ b/app/Views/admin/billing/index.php @@ -7,6 +7,7 @@ 조건검색: include('templates/admin/index_head') ?> + diff --git a/app/Views/admin/board/index.php b/app/Views/admin/board/index.php index 2b28781..efe791a 100644 --- a/app/Views/admin/board/index.php +++ b/app/Views/admin/board/index.php @@ -7,6 +7,7 @@ 조건검색:include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/category/index.php b/app/Views/admin/category/index.php index 44448ef..7b85487 100644 --- a/app/Views/admin/category/index.php +++ b/app/Views/admin/category/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/device/index.php b/app/Views/admin/device/index.php index 50806a8..a3585ed 100644 --- a/app/Views/admin/device/index.php +++ b/app/Views/admin/device/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/order/index.php b/app/Views/admin/order/index.php index 50b7e1f..f1a32e7 100644 --- a/app/Views/admin/order/index.php +++ b/app/Views/admin/order/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/product/index.php b/app/Views/admin/product/index.php index ff7406b..b98f9e5 100644 --- a/app/Views/admin/product/index.php +++ b/app/Views/admin/product/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/sitepage/index.php b/app/Views/admin/sitepage/index.php index 816d95e..c626bd8 100644 --- a/app/Views/admin/sitepage/index.php +++ b/app/Views/admin/sitepage/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/user/index.php b/app/Views/admin/user/index.php index 15cf6b5..4ba60b3 100644 --- a/app/Views/admin/user/index.php +++ b/app/Views/admin/user/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/admin/usersns/index.php b/app/Views/admin/usersns/index.php index 630f1a2..aed1d6f 100644 --- a/app/Views/admin/usersns/index.php +++ b/app/Views/admin/usersns/index.php @@ -3,10 +3,12 @@
+ "get")) ?> include('templates/admin/index_head') ?> +
diff --git a/app/Views/templates/admin/index_head.php b/app/Views/templates/admin/index_head.php index 5630f6f..813b68d 100644 --- a/app/Views/templates/admin/index_head.php +++ b/app/Views/templates/admin/index_head.php @@ -1,19 +1,12 @@ -