shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-04 09:48:56 +09:00
parent 138601e37d
commit dabab59d21
6 changed files with 24 additions and 12 deletions

View File

@ -2,7 +2,6 @@
namespace App\Controllers\Admin; namespace App\Controllers\Admin;
use App\Models\BoardConfigModel;
use App\Models\BoardModel; use App\Models\BoardModel;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;

View File

@ -20,14 +20,14 @@ class BoardController extends FrontController
public function getFields(string $action = ""): array public function getFields(string $action = ""): array
{ {
$fields = ["category_uid", 'title', "board_file", "passwd", "content"]; $fields = ['title', "board_file", "passwd", "content"];
switch ($action) { switch ($action) {
case "index": case "index":
case "excel": case "excel":
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at"]; return ['title', "board_file", "view_cnt", "created_at"];
break; break;
case "view": case "view":
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at", "content"]; return ['title', "board_file", "view_cnt", "created_at", "content"];
break; break;
default: default:
return $fields; return $fields;
@ -36,7 +36,7 @@ class BoardController extends FrontController
} }
public function getFieldFilters(): array public function getFieldFilters(): array
{ {
return ["category_uid", "user_uid"]; return [];
} }
public function getFieldBatchFilters(): array public function getFieldBatchFilters(): array
{ {

View File

@ -79,7 +79,7 @@ CREATE TABLE servermgr.tw_board (
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함', grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요', grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
cartory_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID', category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
user_uid varchar(36) NULL COMMENT '작성자 정보', user_uid varchar(36) NULL COMMENT '작성자 정보',
title varchar(255) NOT NULL COMMENT '제목', title varchar(255) NOT NULL COMMENT '제목',
content text NOT NULL COMMENT '내용', content text NOT NULL COMMENT '내용',

View File

@ -47,7 +47,7 @@ CREATE TABLE shoppingmall.tw_board (
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함', grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요', grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
cartory_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID', category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
user_uid varchar(36) NULL COMMENT '작성자 정보', user_uid varchar(36) NULL COMMENT '작성자 정보',
title varchar(255) NOT NULL COMMENT '제목', title varchar(255) NOT NULL COMMENT '제목',
content text NOT NULL COMMENT '내용', content text NOT NULL COMMENT '내용',

View File

@ -23,6 +23,14 @@ class BoardEntity extends BaseHierarchyEntity
} }
//추가기능 //추가기능
public function getCategory_Uid()
{
return $this->attributes['category_uid'];
}
public function getUser_Uid()
{
return $this->attributes['user_uid'];
}
public function getPassword() public function getPassword()
{ {
return $this->attributes['passwd']; return $this->attributes['passwd'];
@ -31,8 +39,4 @@ class BoardEntity extends BaseHierarchyEntity
{ {
return $this->attributes['view_cnt']; return $this->attributes['view_cnt'];
} }
public function getUser_Uid()
{
return $this->attributes['user_uid'];
}
} }

View File

@ -15,7 +15,7 @@ function getFieldLabel_BoardHelper($field, array $fieldRules, array $attributes
function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array()) function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
{ {
switch ($field) { switch ($field) {
case "board_config_uid": case "category_uid":
case "user_uid": case "user_uid":
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]); return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
@ -59,6 +59,15 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
{ {
$value = $entity->$field ?: DEFAULTS['EMPTY']; $value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case 'category_uid':
$categorys = array();
foreach (array_values($fieldFormOptions[$field]) as $category_2depth) {
foreach ($category_2depth as $key => $label) {
$categorys[$key] = $label;
}
}
return $categorys[$value];
break;
case 'title': case 'title':
return sprintf( return sprintf(
"<div style=\"text-align:left;\">%s %s</div>", "<div style=\"text-align:left;\">%s %s</div>",