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 + } } //조회수 올리기