shoppingmallv2 init...
This commit is contained in:
parent
4fb62f18fd
commit
7e1bb74f08
@ -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":
|
||||||
|
|||||||
@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//장바구니에 넣기
|
//장바구니에 넣기
|
||||||
|
|||||||
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//조회수 올리기
|
//조회수 올리기
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user