shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-09 18:55:59 +09:00
parent c8051a97e0
commit 474a5df7fb
4 changed files with 16 additions and 1 deletions

View File

@ -227,6 +227,7 @@ define('AUDIOS', [
//Default값 정의 //Default값 정의
define('DEFAULTS', [ define('DEFAULTS', [
'ORDER_CATEGORY' => getenv('default.order_category') ?: 11,
'USER_CATEGORY' => getenv('default.user_category') ?: 12, 'USER_CATEGORY' => getenv('default.user_category') ?: 12,
'ROLE' => getenv('default.role') ?: "guest", 'ROLE' => getenv('default.role') ?: "guest",
'STATUS' => getenv('default.status') ?: "use", 'STATUS' => getenv('default.status') ?: "use",

View File

@ -15,7 +15,7 @@ class OrderController extends FrontController
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
$this->_viewPath .= strtolower($this->_model->getClassName()); $this->_viewPath .= strtolower($this->_model->getClassName());
//Default 회원정보 Category //Default 회원정보 Category
$this->_category = DEFAULTS['USER_CATEGORY']; $this->_category = DEFAULTS['ORDER_CATEGORY'];
$this->isRole('index'); $this->isRole('index');
} }

View File

@ -39,6 +39,13 @@ class SitepageController extends FrontController
{ {
return parent::getFieldBatchFilters(); return parent::getFieldBatchFilters();
} }
//권한체크
protected function isRole($action)
{
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
parent::isRole($action);
}
//Index관련 //Index관련
protected function index_process() protected function index_process()
{ {

View File

@ -68,6 +68,13 @@ function getFieldView_OrderHelper($field, $entity, array $viewDatas)
{ {
$value = $entity->$field ?: DEFAULTS['EMPTY']; $value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case 'cost':
case 'price':
case 'sale':
case 'stock':
case 'view_cnt':
return number_format(!$value ? 0 : $value);
break;
case 'content': case 'content':
return html_entity_decode($value); return html_entity_decode($value);
break; break;