diff --git a/app/Cells/BoardCell.php b/app/Cells/BoardCell.php new file mode 100644 index 0000000..151b27c --- /dev/null +++ b/app/Cells/BoardCell.php @@ -0,0 +1,26 @@ +_boardModel = $this->_boardModel ?: new BoardModel(); + } + public function information(array $viewDatas): string + { + helper('Board'); + $viewDatas['cellDatas']=array(); + $viewDatas['cellDatas']['entitys'] = $this->getBoardModel()->getEntitys([ + 'category' => __FUNCTION__ + ]); + return view( + 'Views/front/board/cell/' . __FUNCTION__, + ['viewDatas' => $viewDatas] + ); + } +} diff --git a/app/Cells/ProductCell.php b/app/Cells/ProductCell.php new file mode 100644 index 0000000..1d3428f --- /dev/null +++ b/app/Cells/ProductCell.php @@ -0,0 +1,15 @@ +$viewDatas] + ); + } +} diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 96c5851..ee7a465 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -1,6 +1,7 @@ setAutoRoute(false); //추가 RULE UUID형식 $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); -$routes->get('/', 'Home::index'); +$routes->get('/', 'Front\Home::index'); $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) { }); // authGuard는 App\Config\Filters.php의 $aliases에 선언한 이름이어야 함 @@ -170,8 +171,8 @@ $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($rou }); $routes->group('order', ['namespace' => 'App\Controllers\Front\Order'], static function ($routes) { $routes->get('', 'OrderController::index'); + $routes->post('insert', 'OrderController::insert'); $routes->get('view/(:uuid)', 'OrderController::view/$1'); - $routes->post('addCart', 'CartController::insert'); $routes->get('cancelCart/(:uuid)', 'CartController::delete/$1'); }); $routes->group('billing', ['namespace' => 'App\Controllers\Front\Billing', 'filter' => 'authFilter:user'], static function ($routes) { diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Home.php index 264b876..62cdbb7 100644 --- a/app/Controllers/Admin/Home.php +++ b/app/Controllers/Admin/Home.php @@ -2,43 +2,34 @@ namespace App\Controllers\Admin; -use CodeIgniter\Controller; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class Home extends Controller +class Home extends AdminController { - private $_session = null; - private $_viewDatas = array(); - private $_viewPath = "admin/"; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); - $this->_viewDatas['control'] = 'admin'; - $this->_viewDatas['title'] = '쇼핑몰관리툴페이지'; - $this->_viewDatas['layout'] = LAYOUTS['admin']; - $this->_session = \Config\Services::session(); - $this->_viewDatas['session'] = $this->_session; - $this->_viewDatas['className'] = 'MAIN'; - $this->_viewDatas['class_icon'] = CLASS_ICONS['USER']; - helper("Common"); - // echo var_export($this->_viewDatas['layout'], true); - // exit; - //사용자 기본 Role 지정 - $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false; - $this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]]; - if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) { - $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = true; - $this->_viewDatas['auth'] = $this->_session->get(SESSION_NAMES['AUTH']); - $currentRoles = explode(DEFAULTS['DELIMITER_ROLE'], $this->_viewDatas['auth'][AUTH_FIELDS['ROLE']]); - $this->_viewDatas['currentRoles'] = is_array($currentRoles) ? $currentRoles : [DEFAULTS["ROLE"]]; - } + $this->_viewDatas['className'] = 'Home'; + $this->_viewDatas['title'] = '관리자페이지'; + $this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])]; } + public function getFields(string $action): array + { + return []; + } + public function getFieldFilters(): array + { + return []; + } + //Index 관련 public function index() { + helper('form'); + $this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: ""); return view($this->_viewPath . 'welcome_message', ['viewDatas' => $this->_viewDatas]); } } diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 4c9130f..b97bcd2 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -136,20 +136,23 @@ abstract class BaseController extends Controller } //초기화 - final public function init(string $action, $fields = null) + final public function action_init(array $viewDatas) { - switch ($action) { + switch ($viewDatas['action']) { case 'insert_form': $action = 'insert'; break; case 'update_form': $action = 'update'; break; + default: + $action = $viewDatas['action']; + break; } - $this->_viewDatas['fields'] = $fields ?: $this->getFields($action); - $this->_viewDatas['fieldRules'] = $this->getFieldRules($this->_viewDatas['fields'], $action); - $this->_viewDatas['fieldFilters'] = $this->getFieldFilters(); - $this->_viewDatas['batchjobFilters'] = $this->getFieldBatchFilters(); + $this->_viewDatas['fields'] = array_key_exists('fields', $viewDatas) ? $viewDatas['fields'] : $this->getFields($action); + $this->_viewDatas['fieldRules'] = $this->getFieldRules($this->_viewDatas['fields'], $action); + $this->_viewDatas['fieldFilters'] = $this->getFieldFilters(); + $this->_viewDatas['batchjobFilters'] = $this->getFieldBatchFilters(); $this->_viewDatas['fieldFormOptions'] = $this->getFieldFormOptions($this->_viewDatas['fieldFilters']); return $this->_viewDatas; } @@ -162,7 +165,7 @@ abstract class BaseController extends Controller public function insert_form() { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $this->insert_form_process(); helper(['form']); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); @@ -190,22 +193,25 @@ abstract class BaseController extends Controller { return $this->_model->create($this->_viewDatas['fieldDatas']); } - public function insert() + final public function insert() { - $msg = ""; + //Transaction 시작 + $this->_model->transStart(); try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $this->insert_validate(); $entity = $this->insert_process(); - $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."; + //Transaction Commit + $this->_model->transComplete(); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { - $msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage(); + //Transaction Rollback + $this->_model->transRollback(); log_message("error", $e->getMessage()); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); return redirect()->back()->withInput(); - } finally { - $this->_session->setFlashdata("return_message", $msg); } } @@ -218,7 +224,7 @@ abstract class BaseController extends Controller public function update_form($uid) { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->_viewDatas['entity'] = $this->update_form_process($entity); helper(['form']); @@ -261,23 +267,26 @@ abstract class BaseController extends Controller { return $this->_model->modify($entity, $this->_viewDatas['fieldDatas']); } - public function update($uid) + final public function update($uid) { - $msg = ""; + //Transaction 시작 + $this->_model->transStart(); try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->update_validate($entity); $entity = $this->update_process($entity); - $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."; + //Transaction Commit + $this->_model->transComplete(); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { - $msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage(); + //Transaction Rollback + $this->_model->transRollback(); log_message("error", $e->getMessage()); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); return redirect()->back()->withInput(); - } finally { - $this->_session->setFlashdata("return_message", $msg); } } @@ -292,7 +301,7 @@ abstract class BaseController extends Controller public function reply_form($uid) { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->_viewDatas['entity'] = $this->reply_form_process($entity); helper(['form']); @@ -321,23 +330,26 @@ abstract class BaseController extends Controller { return $this->_model->reply($entity, $this->_viewDatas['fieldDatas']); } - public function reply($uid) + final public function reply($uid) { - $msg = ""; + //Transaction 시작 + $this->_model->transStart(); try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->reply_validate($entity); $entity = $this->reply_process($entity); - $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."; + //Transaction Commit + $this->_model->transComplete(); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { - $msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage(); + //Transaction Rollback + $this->_model->transRollback(); log_message("error", $e->getMessage()); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); return redirect()->back()->withInput(); - } finally { - $this->_session->setFlashdata("return_message", $msg); } } @@ -360,22 +372,25 @@ abstract class BaseController extends Controller { return $this->_model->modify($entity, $this->_viewDatas['fieldDatas']); } - public function toggle($uid, string $field) + final public function toggle($uid, string $field) { - $msg = ""; + //Transaction 시작 + $this->_model->transStart(); try { - $this->_viewDatas = $this->init(__FUNCTION__, [$field]); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__, 'fields' => [$field]]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->toggle_validate($entity); $entity = $this->toggle_process($entity); - $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."; + //Transaction Commit + $this->_model->transComplete(); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { - $msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage(); + //Transaction Rollback + $this->_model->transRollback(); log_message("error", $e->getMessage()); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); - } finally { - $this->_session->setFlashdata("return_message", $msg); } } //Batchjob 관련 @@ -397,12 +412,13 @@ abstract class BaseController extends Controller { return $this->_model->modify($entity, $this->_viewDatas['fieldDatas']); } - public function batchjob() + final public function batchjob() { - $msg = ""; - $uids = array(); - $entitys = array(); + $uids = array(); + $entitys = array(); $batchjobs = array(); + //Transaction 시작 + $this->_model->transStart(); try { //fields 해당하는 field중 선택된 값이 있는경우만 fields로 정의 $fields = array(); @@ -414,11 +430,9 @@ abstract class BaseController extends Controller if (!is_array($fields) || count($fields) === 0) { throw new \Exception($this->_viewDatas['title'] . '에서 변경할 항목(field)이 선택되지 않았습니다.'); } - $this->_viewDatas = $this->init(__FUNCTION__, $fields); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__, 'fields' => $fields]); $uids = $this->request->getVar('batchjob_uids') ?: throw new \Exception($this->_viewDatas['title'] . '에서 변경할 항목(uid)이 선택되지 않았습니다.'); $cnt = 1; - //Transaction 시작 - $this->_model->transStart(); foreach ($uids as $uid) { try { $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); @@ -433,29 +447,29 @@ abstract class BaseController extends Controller } //Transaction Commit $this->_model->transComplete(); - $msg = sprintf( - "%s에서 총:%s개의 %s 완료하였습니다.", - $this->_viewDatas['title'], - count($entitys), - __FUNCTION__ + $this->_session->setFlashdata( + "return_message", + sprintf("%s에서 총:%s개의 %s 완료하였습니다.", $this->_viewDatas['title'], count($entitys), __FUNCTION__,), ); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { //Transaction Rollback $this->_model->transRollback(); - log_message('error', sprintf("---------batchjob 작업결과--------\n%s\n", implode("\n", $batchjobs))); - return sprintf( - "총:%s개의 작업중 %s개는 성공하였지만 , %s개가 실패하여 %s 취소되었습니다.\n%s", - count($uids), - count($entitys), - count($uids) - count($entitys), - __FUNCTION__, - $e->getMessage() - ); log_message("error", $e->getMessage()); + $this->_session->setFlashdata( + "return_message", + sprintf( + "총:%s개의 작업중 %s개는 성공하였지만 , %s개가 실패하여 %s 취소되었습니다.\n%s", + count($uids), + count($entitys), + count($uids) - count($entitys), + __FUNCTION__, + $e->getMessage(), + ), + ); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } finally { - $this->_session->setFlashdata("return_message", $msg); + log_message('error', sprintf("---------batchjob 작업결과--------\n%s\n", implode("\n", $batchjobs))); } } @@ -469,20 +483,23 @@ abstract class BaseController extends Controller } return $entity; } - public function delete($uid) + final public function delete($uid) { - $msg = ""; + //Transaction 시작 + $this->_model->transStart(); try { $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->delete_process($entity); - $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."; + //Transaction Commit + $this->_model->transComplete(); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다."); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { - $msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage(); + //Transaction Rollback + $this->_model->transRollback(); log_message("error", $e->getMessage()); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); - } finally { - $this->_session->setFlashdata("return_message", $msg); } } @@ -495,7 +512,7 @@ abstract class BaseController extends Controller public function view($uid) { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->_viewDatas['entity'] = $this->view_process($entity); helper(['form']); @@ -567,7 +584,7 @@ abstract class BaseController extends Controller public function index() { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); foreach ($this->_viewDatas['fieldFilters'] as $field) { $this->_viewDatas[$field] = $this->request->getVar($field) ?: DEFAULTS['EMPTY']; } @@ -599,6 +616,7 @@ abstract class BaseController extends Controller $this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: ""); return view($this->_viewPath . '/index' . $this->request->getVar('v') ?: '', ['viewDatas' => $this->_viewDatas]); } catch (\Exception $e) { + log_message("error", $e->getMessage()); return alert_CommonHelper($e->getMessage(), "back"); // return redirect()->back()->with('return_message', $e->getMessage()); } @@ -625,10 +643,10 @@ abstract class BaseController extends Controller // $writer->save($fileName . '.pdf'); return $writer; } - public function excel() + final public function excel() { try { - $this->_viewDatas = $this->init(__FUNCTION__); + $this->_viewDatas = $this->action_init(['action' => __FUNCTION__]); $this->_viewDatas['Entitys'] = $this->index_getEntitys(); $html = view( $this->_viewPath . '/excel', diff --git a/app/Controllers/Front/Home.php b/app/Controllers/Front/Home.php new file mode 100644 index 0000000..dbdc4c6 --- /dev/null +++ b/app/Controllers/Front/Home.php @@ -0,0 +1,35 @@ +_viewDatas['parts'] = Product['parts']; + // dd($this->_viewDatas); + $this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: ""); + return view($this->_viewPath . 'welcome_message', ['viewDatas' => $this->_viewDatas]); + } +} diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php deleted file mode 100644 index 4b86f99..0000000 --- a/app/Controllers/Home.php +++ /dev/null @@ -1,45 +0,0 @@ -_viewDatas['control'] = 'main'; - $this->_viewDatas['title'] = '쇼핑몰페이지'; - $this->_viewDatas['layout'] = LAYOUTS['main']; - $this->_session = \Config\Services::session(); - $this->_viewDatas['session'] = $this->_session; - $this->_viewDatas['className'] = 'MAIN'; - // echo var_export($this->_viewDatas['layout'], true); - // exit; - //사용자 기본 Role 지정 - $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false; - $this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]]; - if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) { - $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = true; - $this->_viewDatas['auth'] = $this->_session->get(SESSION_NAMES['AUTH']); - $currentRoles = explode(DEFAULTS['DELIMITER_ROLE'], $this->_viewDatas['auth'][AUTH_FIELDS['ROLE']]); - $this->_viewDatas['currentRoles'] = is_array($currentRoles) ? $currentRoles : [DEFAULTS["ROLE"]]; - } - //Default 회원정보 Category - $this->_viewDatas['category'] = new CategoryEntity(['uid' => 1]); - } - - - public function index() - { - return view($this->_viewPath . 'welcome_message', ['viewDatas' => $this->_viewDatas]); - } -} diff --git a/app/Controllers/Trait/CartTrait.php b/app/Controllers/Trait/CartTrait.php new file mode 100644 index 0000000..3e9b57d --- /dev/null +++ b/app/Controllers/Trait/CartTrait.php @@ -0,0 +1,66 @@ +_orderModel = $this->_orderModel ?: new OrderModel(); + } + private function getProductModel(): ProductModel + { + return $this->_serverModel = $this->_serverModel ?: new ProductModel(); + } + + public function add_procedure(ProductEntity $product, int $quantity, int $paymentDay = null): OrderEntity + { + //상품재고감소 + $product = $this->getProductModel()->addCart($product, $quantity); + //주문추가 + $entity = $this->getOrderModel()->addCart($product, $quantity, $product->type, $paymentDay); + //주문정보 세션에 넣기 + $order_uids = $this->_session->get(SESSION_NAMES['CART']) ?: array(); + $this->_session->set(SESSION_NAMES['CART'], [...$order_uids, $entity->getPrimaryKey()]); + $this->_session->setFlashdata( + "return_message", + sprintf( + "%s\n 상품명:%s\n 상품갯수:%s개, 구매금액:%s원\n 장바구니에 담았습니다.", + $this->_viewDatas['title'], + $entity->getTitle(), + $entity->quantity, + number_format($entity->price), + ), + ); + return $entity; + } + + public function cancel_procedure($uid) + { + //주문정보 가져오기 + $entity = $this->getOrderModel()->getEntity([$this->getOrderModel()->getPrimaryKey() => $uid]); + //상품정보 가져오기 + $product = $this->getProductModel()->getEntity([$this->getProductModel()->getPrimaryKey() => $entity->product_uid]); + //주문취소 + $entity = $this->getOrderModel()->cancelCart($entity); + //상품반환 + $product = $this->getProductModel()->cancelCart($product, $entity->quantity); + //주문정보 세션에서 빼기 + $order_uids = $this->_session->get(SESSION_NAMES['CART']) ?: array(); + $temps = array(); + foreach ($order_uids as $order_uid) { + if ($order_uid != $entity->getPrimaryKey()) { + array_push($temps, $order_uid); + } + } + $this->_session->set(SESSION_NAMES['CART'], $temps); + $this->_session->setFlashdata("return_message", "{$this->_viewDatas['title']}에서 {$entity->getTitle()} {$entity->quantity}개의 주문을 취소하였습니다."); + } +} diff --git a/app/Database/base.sql b/app/Database/base.sql index 159a2d2..c462639 100644 --- a/app/Database/base.sql +++ b/app/Database/base.sql @@ -1,7 +1,7 @@ -DROP TABLE IF EXISTS baseproject.tw_user; +DROP TABLE IF EXISTS vhost.tw_user; -CREATE TABLE baseproject.tw_user ( +CREATE TABLE vhost.tw_user ( uid varchar(36) NOT NULL COMMENT "사용자 UUID", id varchar(30) NOT NULL, passwd varchar(100) NOT NULL, @@ -19,11 +19,11 @@ CREATE TABLE baseproject.tw_user ( 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 baseproject.tw_user_profile; +DROP TABLE IF EXISTS vhost.tw_user_profile; -DROP TABLE IF EXISTS baseproject.tw_user_sns; +DROP TABLE IF EXISTS vhost.tw_user_sns; -CREATE TABLE baseproject.tw_user_sns ( +CREATE TABLE vhost.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 등등', @@ -40,14 +40,14 @@ CREATE TABLE baseproject.tw_user_sns ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='SNS 로그인 후 정보'; -DROP TABLE IF EXISTS baseproject.tw_category; +DROP TABLE IF EXISTS vhost.tw_category; -- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업 -- update tw_category set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno -- 2. 게시물 추가시 작업 -- insert tw_category grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1 -- 3. 게시물 조회시 작업 -- select * from tw_category order by grpno desc,grporder asc -CREATE TABLE baseproject.tw_category ( +CREATE TABLE vhost.tw_category ( uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT, grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함', grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', @@ -70,14 +70,14 @@ CREATE TABLE baseproject.tw_category ( PRIMARY KEY (uid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='분류'; -DROP TABLE IF EXISTS baseproject.tw_board; +DROP TABLE IF EXISTS vhost.tw_board; -- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업 -- update tw_board set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno -- 2. 게시물 추가시 작업 -- insert tw_board grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1 -- 3. 게시물 조회시 작업 -- select * from tw_board order by grpno desc,grporder asc -CREATE TABLE baseproject.tw_board ( +CREATE TABLE vhost.tw_board ( uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT, grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함', grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', diff --git a/app/Views/welcome_message.php b/app/Views/front/welcome_message.php similarity index 99% rename from app/Views/welcome_message.php rename to app/Views/front/welcome_message.php index 4b2e4c0..6910f05 100644 --- a/app/Views/welcome_message.php +++ b/app/Views/front/welcome_message.php @@ -234,7 +234,7 @@
공지사항
- include($viewDatas['layout']['path'] . '/board'); ?> +
diff --git a/app/Views/layouts/front/top_menu.php b/app/Views/layouts/front/top_menu.php index 2873977..11d1cae 100644 --- a/app/Views/layouts/front/top_menu.php +++ b/app/Views/layouts/front/top_menu.php @@ -5,36 +5,28 @@ diff --git a/app/Views/layouts/common/top_navigator/member_link.php b/app/Views/layouts/front/top_navigator/member_link.php similarity index 100% rename from app/Views/layouts/common/top_navigator/member_link.php rename to app/Views/layouts/front/top_navigator/member_link.php diff --git a/app/Views/layouts/common/top_navigator/search.php b/app/Views/layouts/front/top_navigator/search.php similarity index 100% rename from app/Views/layouts/common/top_navigator/search.php rename to app/Views/layouts/front/top_navigator/search.php diff --git a/app/Views/layouts/common/top_navigator/top_center.php b/app/Views/layouts/front/top_navigator/top_center.php similarity index 100% rename from app/Views/layouts/common/top_navigator/top_center.php rename to app/Views/layouts/front/top_navigator/top_center.php