shoppingmallv2 init...
This commit is contained in:
parent
86ab243842
commit
a01389d345
@ -21,14 +21,14 @@ class CategoryController extends AdminController
|
|||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "head", "tail",
|
"status", "head", "tail",
|
||||||
];
|
];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return [
|
return [
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "created_at"
|
"status", "created_at"
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -51,7 +51,6 @@ CREATE TABLE servermgr.tw_category (
|
|||||||
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씩 추가필요',
|
||||||
name varchar(255) NOT NULL COMMENT '범주명',
|
name varchar(255) NOT NULL COMMENT '범주명',
|
||||||
linkurl varchar(255) NULL COMMENT '연결URL',
|
|
||||||
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
||||||
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
||||||
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
||||||
|
|||||||
@ -19,7 +19,6 @@ CREATE TABLE shoppingmall.tw_category (
|
|||||||
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씩 추가필요',
|
||||||
name varchar(255) NOT NULL COMMENT '범주명',
|
name varchar(255) NOT NULL COMMENT '범주명',
|
||||||
linkurl varchar(255) NULL COMMENT '연결URL',
|
|
||||||
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
||||||
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
||||||
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
||||||
|
|||||||
@ -23,10 +23,6 @@ class CategoryEntity extends BaseHierarchyEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
public function getLinkURL()
|
|
||||||
{
|
|
||||||
return $this->attributes['linkurl'];
|
|
||||||
}
|
|
||||||
public function getHead()
|
public function getHead()
|
||||||
{
|
{
|
||||||
return $this->attributes['head'];
|
return $this->attributes['head'];
|
||||||
|
|||||||
@ -56,9 +56,6 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar
|
|||||||
case 'name':
|
case 'name':
|
||||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||||
break;
|
break;
|
||||||
case 'linkurl':
|
|
||||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)/front/board", "style" => "width:100%; ::placeholder{ color:silver; opacity: 1; }"]);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return form_input($field, $value, [...$attributes]);
|
return form_input($field, $value, [...$attributes]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -9,7 +9,6 @@ return [
|
|||||||
'label' => [
|
'label' => [
|
||||||
'uid' => "번호",
|
'uid' => "번호",
|
||||||
'name' => "범주제목",
|
'name' => "범주제목",
|
||||||
'linkurl' => "연결URL",
|
|
||||||
'isaccess' => "접속권한",
|
'isaccess' => "접속권한",
|
||||||
'isread' => "읽기권한",
|
'isread' => "읽기권한",
|
||||||
'iswrite' => "쓰기권한",
|
'iswrite' => "쓰기권한",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
parent::__construct('Category');
|
parent::__construct('Category');
|
||||||
$this->allowedFields = [
|
$this->allowedFields = [
|
||||||
...$this->allowedFields,
|
...$this->allowedFields,
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"head", "tail", "status"
|
"head", "tail", "status"
|
||||||
];
|
];
|
||||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||||
@ -33,10 +33,6 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
$rules[$field] = "required|trim|string";
|
$rules[$field] = "required|trim|string";
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
case "linkurl":
|
|
||||||
$rules[$field] = "if_exist|trim|string";
|
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
|
||||||
break;
|
|
||||||
case "isaccess":
|
case "isaccess":
|
||||||
case "isread":
|
case "isread":
|
||||||
case "iswrite":
|
case "iswrite":
|
||||||
@ -119,7 +115,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
{
|
{
|
||||||
parent::setIndexWordFilter($word);
|
parent::setIndexWordFilter($word);
|
||||||
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
||||||
$this->orLike("linkurl", $word, "both"); //befor , after , both
|
$this->orLike($word, "both"); //befor , after , both
|
||||||
$this->orLike("head", $word, "both"); //befor , after , both
|
$this->orLike("head", $word, "both"); //befor , after , both
|
||||||
$this->orLike("tail", $word, "both"); //befor , after , both
|
$this->orLike("tail", $word, "both"); //befor , after , both
|
||||||
$this->orLike("isaccess", $word, "both"); //befor , after , both
|
$this->orLike("isaccess", $word, "both"); //befor , after , both
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user