shoppingmallv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-05 20:50:02 +09:00
parent 4fb62f18fd
commit 7e1bb74f08
3 changed files with 9 additions and 13 deletions

View File

@ -9,23 +9,15 @@ use Psr\Log\LoggerInterface;
class BoardController extends FrontController class BoardController extends FrontController
{ {
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{ {
$this->_model = new BoardModel($this->getFields()); $this->_model = new BoardModel($this->getFields());
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
$this->_viewPath .= strtolower($this->_model->getClassName()); $this->_viewPath .= strtolower($this->_model->getClassName());
} }
public function getFields(string $action = ""): array public function getFields(string $action = ""): array
{ {
$fields = ['title', "board_file", "passwd", "content"]; $fields = ['title', "board_file", "passwd", "content"];
try {
//권한체크
$this->isRole('upload');
} catch (\Exception $e) {
$fields = ['title', "passwd", "content"];
}
switch ($action) { switch ($action) {
case "index": case "index":
case "excel": case "excel":

View File

@ -75,8 +75,10 @@ class OrderModel extends BaseModel
//Index관련 //Index관련
public function setIndexWordFilter(string $word) public function setIndexWordFilter(string $word)
{ {
parent::setIndexWordFilter($word); if ($word !== DEFAULTS['EMPTY']) {
$this->orLike($this->getTitleField(), $word, "both"); parent::setIndexWordFilter($word);
$this->orLike($this->getTitleField(), $word, "both");
}
} }
//장바구니에 넣기 //장바구니에 넣기

View File

@ -97,9 +97,11 @@ class ProductModel extends BaseModel
//Index관련 //Index관련
public function setIndexWordFilter(string $word) public function setIndexWordFilter(string $word)
{ {
parent::setIndexWordFilter($word); if ($word !== DEFAULTS['EMPTY']) {
$this->orLike($this->getTitleField(), $word, "both"); parent::setIndexWordFilter($word);
$this->orLike("content", $word, "both"); //befor , after , both $this->orLike($this->getTitleField(), $word, "both");
$this->orLike("content", $word, "both"); //befor , after , both
}
} }
//조회수 올리기 //조회수 올리기