shoppingmallv2 init...
This commit is contained in:
parent
b31992a0fe
commit
70ba4dc67b
@ -60,4 +60,11 @@ class BoardController extends FrontController
|
|||||||
}
|
}
|
||||||
return $this->_viewDatas['fieldDatas'];
|
return $this->_viewDatas['fieldDatas'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//View관련
|
||||||
|
protected function view_process($entity)
|
||||||
|
{
|
||||||
|
$entity = parent::view_process($entity);
|
||||||
|
return $this->_model->addViewCount($entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,4 +53,11 @@ class ProductController extends FrontController
|
|||||||
}
|
}
|
||||||
return $this->_viewDatas['fieldDatas'];
|
return $this->_viewDatas['fieldDatas'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//View관련
|
||||||
|
protected function view_process($entity)
|
||||||
|
{
|
||||||
|
$entity = parent::view_process($entity);
|
||||||
|
return $this->_model->addViewCount($entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,4 +95,11 @@ class BoardModel extends BaseHierarchyModel
|
|||||||
$this->orLike($this->getTitleField(), $word, "both");
|
$this->orLike($this->getTitleField(), $word, "both");
|
||||||
$this->orLike("content", $word, "both"); //befor , after , both
|
$this->orLike("content", $word, "both"); //befor , after , both
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//조회수 올리기
|
||||||
|
final public function addViewCount(BoardEntity $entity, int $view_cnt = 1): BoardEntity
|
||||||
|
{
|
||||||
|
$entity->view_cnt += $view_cnt;
|
||||||
|
return $this->save_process($entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,6 +115,13 @@ class ProductModel extends BaseModel
|
|||||||
$this->orLike("content", $word, "both"); //befor , after , both
|
$this->orLike("content", $word, "both"); //befor , after , both
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//조회수 올리기
|
||||||
|
final public function addViewCount(ProductEntity $entity, int $view_cnt = 1): ProductEntity
|
||||||
|
{
|
||||||
|
$entity->view_cnt += $view_cnt;
|
||||||
|
return $this->save_process($entity);
|
||||||
|
}
|
||||||
|
|
||||||
//장바구니에 넣기
|
//장바구니에 넣기
|
||||||
final public function addCart(ProductEntity $entity, int $quantity): ProductEntity
|
final public function addCart(ProductEntity $entity, int $quantity): ProductEntity
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user