From 789d2c5cb7d7a19d80573711601b45f18dbbaa8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 31 Jul 2023 17:43:31 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Backend/BaseHierarchyBackend.php | 7 ------- app/Backend/BoardBackend.php | 8 ++++++++ .../{CartgoryBackend.php => CategoryBackend.php} | 0 app/Config/Services.php | 2 +- app/Controllers/BaseController.php | 2 +- app/Helpers/Category_helper.php | 2 +- app/Models/CategoryModel.php | 6 +++--- app/Models/OrderModel.php | 10 +++++----- app/Views/admin/order/index.php | 2 +- 9 files changed, 20 insertions(+), 19 deletions(-) rename app/Backend/{CartgoryBackend.php => CategoryBackend.php} (100%) diff --git a/app/Backend/BaseHierarchyBackend.php b/app/Backend/BaseHierarchyBackend.php index 75a0d32..d10d640 100644 --- a/app/Backend/BaseHierarchyBackend.php +++ b/app/Backend/BaseHierarchyBackend.php @@ -18,11 +18,4 @@ abstract class BaseHierarchyBackend extends BaseBackend { return $this->_model->reply($entity, $fieldDatas); } - //View관련 - public function view($entity) - { - // view_cnt에 추가하기위함 - $this->_model->increaseViewCount($entity->getPrimaryKey()); - return parent::view($entity); - } } diff --git a/app/Backend/BoardBackend.php b/app/Backend/BoardBackend.php index 5172e54..0cc30ba 100644 --- a/app/Backend/BoardBackend.php +++ b/app/Backend/BoardBackend.php @@ -36,4 +36,12 @@ class BoardBackend extends BaseHierarchyBackend } return $options; } + + //View관련 + public function view($entity) + { + //view_cnt에 추가하기위함 + $this->_model->increaseViewCount($entity->getPrimaryKey()); + return parent::view($entity); + } } diff --git a/app/Backend/CartgoryBackend.php b/app/Backend/CategoryBackend.php similarity index 100% rename from app/Backend/CartgoryBackend.php rename to app/Backend/CategoryBackend.php diff --git a/app/Config/Services.php b/app/Config/Services.php index 7d2eca1..e4fbd42 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -64,7 +64,7 @@ class Services extends BaseService } return new \App\Backend\CategoryBackend(); } - public static function prodcut($getShared = true) + public static function product($getShared = true) { if ($getShared) { return static::getSharedInstance('product'); diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 9a5cfa0..ceb7d21 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -515,7 +515,7 @@ abstract class BaseController extends Controller final public function download(string $field, $uid) { try { - $entity = $this->_backend->getEntity([$this->_backend->getPrimaryKey() => $uid]); + $entity = $this->_backend->getEntity($uid); if (!$entity->$field) { throw new \Exception("첨부파일이 확인되지 않습니다."); } diff --git a/app/Helpers/Category_helper.php b/app/Helpers/Category_helper.php index c60a2e8..73eb02f 100644 --- a/app/Helpers/Category_helper.php +++ b/app/Helpers/Category_helper.php @@ -25,7 +25,7 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]); break; case "status": - $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Categor.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; + $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], $attributes); break; case 'updated_at': diff --git a/app/Models/CategoryModel.php b/app/Models/CategoryModel.php index b4750bd..c69b815 100644 --- a/app/Models/CategoryModel.php +++ b/app/Models/CategoryModel.php @@ -74,10 +74,10 @@ class CategoryModel extends BaseHierarchyModel $old_title = ""; foreach ($this->where($conditions)->orderby("grpno DESC, grporder ASC")->findAll() as $entity) { if ($entity->getPrimaryKey() == $entity->getHierarchy_No()) { - $options[$entity->getTitleField()] = []; - $old_title = $entity->getTitleField(); + $options[$entity->getTitle()] = []; + $old_title = $entity->getTitle(); } else { - $options[$old_title][$entity->getPrimaryKey()] = $entity->getTitleField(); + $options[$old_title][$entity->getPrimaryKey()] = $entity->getTitle(); } } return $options; diff --git a/app/Models/OrderModel.php b/app/Models/OrderModel.php index 787fc4c..8788a66 100644 --- a/app/Models/OrderModel.php +++ b/app/Models/OrderModel.php @@ -22,12 +22,12 @@ class OrderModel extends BaseModel } final public function getFields(string $action = ""): array { - $fields = [$this->getTitle(), "quantity", "price", "status"]; + $fields = [$this->getTitleField(), "quantity", "price", "status"]; switch ($action) { case "index": case "excel": case "view": - return [$this->getTitle(), "user_uid", "sess_id", "quantity", "price", "status", "updated_at", "created_at"]; + return [$this->getTitleField(), "user_uid", "sess_id", "quantity", "price", "status", "updated_at", "created_at"]; break; default: return $fields; @@ -36,7 +36,7 @@ class OrderModel extends BaseModel } final public function getFieldFilters(): array { - return [$this->getTitle(), "user_uid", "status"]; + return [$this->getTitleField(), "user_uid", "status"]; } final public function getFieldBatchFilters(): array { @@ -45,7 +45,7 @@ class OrderModel extends BaseModel protected function getFieldRule(string $field, array $rules, string $action = ""): array { switch ($field) { - case $this->getTitle(): + case $this->getTitleField(): case "user_uid": $rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]"; break; @@ -94,6 +94,6 @@ class OrderModel extends BaseModel public function setIndexWordFilter(string $word) { parent::setIndexWordFilter($word); - $this->orLike($this->getTitle(), $word, "both"); + $this->orLike($this->getTitleField(), $word, "both"); } } diff --git a/app/Views/admin/order/index.php b/app/Views/admin/order/index.php index cfed366..a620eb7 100644 --- a/app/Views/admin/order/index.php +++ b/app/Views/admin/order/index.php @@ -21,7 +21,7 @@ getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);"> "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> - "_self"] ?> +