From 7e1bb74f086ca2d1066fa00339a0a52311bf3330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Sat, 5 Aug 2023 20:50:02 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/Front/BoardController.php | 8 -------- app/Models/OrderModel.php | 6 ++++-- app/Models/ProductModel.php | 8 +++++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index 8cf3bbd..ed503a6 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -9,23 +9,15 @@ use Psr\Log\LoggerInterface; class BoardController extends FrontController { - public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { $this->_model = new BoardModel($this->getFields()); parent::initController($request, $response, $logger); $this->_viewPath .= strtolower($this->_model->getClassName()); } - public function getFields(string $action = ""): array { $fields = ['title', "board_file", "passwd", "content"]; - try { - //권한체크 - $this->isRole('upload'); - } catch (\Exception $e) { - $fields = ['title', "passwd", "content"]; - } switch ($action) { case "index": case "excel": diff --git a/app/Models/OrderModel.php b/app/Models/OrderModel.php index 6107225..9dff072 100644 --- a/app/Models/OrderModel.php +++ b/app/Models/OrderModel.php @@ -75,8 +75,10 @@ class OrderModel extends BaseModel //Index관련 public function setIndexWordFilter(string $word) { - parent::setIndexWordFilter($word); - $this->orLike($this->getTitleField(), $word, "both"); + if ($word !== DEFAULTS['EMPTY']) { + parent::setIndexWordFilter($word); + $this->orLike($this->getTitleField(), $word, "both"); + } } //장바구니에 넣기 diff --git a/app/Models/ProductModel.php b/app/Models/ProductModel.php index 48c0cf2..b5b51ff 100644 --- a/app/Models/ProductModel.php +++ b/app/Models/ProductModel.php @@ -97,9 +97,11 @@ class ProductModel extends BaseModel //Index관련 public function setIndexWordFilter(string $word) { - parent::setIndexWordFilter($word); - $this->orLike($this->getTitleField(), $word, "both"); - $this->orLike("content", $word, "both"); //befor , after , both + if ($word !== DEFAULTS['EMPTY']) { + parent::setIndexWordFilter($word); + $this->orLike($this->getTitleField(), $word, "both"); + $this->orLike("content", $word, "both"); //befor , after , both + } } //조회수 올리기