shoppingmallv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-05 07:55:03 +09:00
parent a0c66ee3ec
commit 82d0727589
4 changed files with 44 additions and 13 deletions

View File

@ -531,8 +531,8 @@ abstract class BaseController extends Controller
//Totalcount 처리
$this->index_setCondition();
$this->_viewDatas['total_count'] = $this->_model->countAllResults();
// echo $this->_model->getLastQuery();
// echo "<HR>";
echo $this->_model->getLastQuery();
echo "<HR>";
// log_message("debug", __METHOD__ . "에서 TotalCount 호출:" . $this->_model->getLastQuery());
//Page, Per_page필요부분
$this->_viewDatas['page'] = (int)$this->request->getVar('page') ?: 1;
@ -547,7 +547,7 @@ abstract class BaseController extends Controller
$this->_viewDatas['pagination'] = $this->index_getPagination();
//모델 처리
$this->_viewDatas['entitys'] = $this->index_getEntitys();
// echo $this->_model->getLastQuery();
echo $this->_model->getLastQuery();
// log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery());
//setting return_url to session flashdata
helper(['form']);

View File

@ -10,7 +10,7 @@ use Psr\Log\LoggerInterface;
class BoardController extends FrontController
{
private $_category_uid = null;
private $_category = null;
private $_categoryModel = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
@ -69,8 +69,8 @@ class BoardController extends FrontController
//Insert관련
protected function insert_form_process()
{
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
$this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'],
@ -83,8 +83,8 @@ class BoardController extends FrontController
}
protected function insert_process()
{
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
$this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'],
@ -180,8 +180,8 @@ class BoardController extends FrontController
//Index관련
protected function index_process()
{
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
$this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 ACCESS권한이 있는지 확인
if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'],
@ -195,7 +195,7 @@ class BoardController extends FrontController
//Category 및 Status 조건추가
protected function index_setCondition()
{
$this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey());
$this->_model->where("category", $this->_viewDatas['category']->getPrimaryKey());
$this->_model->where("status", DEFAULTS['STATUS']);
parent::index_setCondition();
}

View File

@ -1,3 +1,34 @@
DROP TABLE IF EXISTS shoppingmall.tw_user;
CREATE TABLE shoppingmall.tw_user (
uid varchar(36) NOT NULL COMMENT "사용자 UUID",
id varchar(30) NOT NULL,
passwd varchar(100) NOT NULL,
name varchar(20) NOT NULL COMMENT "사용자명",
email varchar(50) NOT NULL,
role varchar(255) NOT NULL DEFAULT 'user' COMMENT '사용자등급',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,
PRIMARY KEY (uid),
UNIQUE KEY (id),
UNIQUE KEY (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 정보';
-- insert into tw_user (uid,id,passwd,name,email,role,status) select uuid(),id,passwd,name,email,role,status from cfmgr.user;
DROP TABLE IF EXISTS shoppingmall.tw_user_profile;
DROP TABLE IF EXISTS shoppingmall.tw_user_sns;
CREATE TABLE shoppingmall.tw_user_sns (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
user_uid varchar(36) NULL COMMENT '사용자 정보',
site varchar(20) NOT NULL COMMENT 'Site: GOOGLE,FACEBOOK 등등',
id varchar(255) NOT NULL COMMENT 'sns 로그인 인중후 Return ID값',
name varchar(50) NOT NULL,
email varchar(50) NOT NULL,
detail text NOT NULL COMMENT 'JSON형식 원본값',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (uid),

View File

@ -1,6 +1,6 @@
<div class="accordion-item">
<h2><a href="/front/board?category_uid=3"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2>
<h2><a href="/front/board?category=2"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2>
</div>
<div class="accordion-item">
<h2><a href="/front/board?category_uid=4"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2>
<h2><a href="/front/board?category_uid=3"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2>
</div>