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