From 82d07275893cc04a02e74caf2a743a4d72884458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Sat, 5 Aug 2023 07:55:03 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/BaseController.php | 6 ++-- app/Controllers/Front/BoardController.php | 16 +++++------ app/Database/shoppingmall.sql | 31 +++++++++++++++++++++ app/Views/layouts/front/left_menu/board.php | 4 +-- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 368dff3..96a1386 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -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 "
"; + echo $this->_model->getLastQuery(); + echo "
"; // 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']); diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index 49154f8..9f49e42 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -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(); } diff --git a/app/Database/shoppingmall.sql b/app/Database/shoppingmall.sql index 7c38c1c..5af66c1 100644 --- a/app/Database/shoppingmall.sql +++ b/app/Database/shoppingmall.sql @@ -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), diff --git a/app/Views/layouts/front/left_menu/board.php b/app/Views/layouts/front/left_menu/board.php index a7d87b1..2a2fd10 100644 --- a/app/Views/layouts/front/left_menu/board.php +++ b/app/Views/layouts/front/left_menu/board.php @@ -1,6 +1,6 @@
-

공지사항

+

공지사항

-

FAQ

+

FAQ

\ No newline at end of file