diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 3e8a4394..2d4d543a 100644 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -87,6 +87,11 @@ class Crud extends Command */ protected $reservedField = ['admin_id', 'createtime', 'updatetime']; + /** + * 排除字段 + */ + protected $ignoreFields = []; + /** * 排序字段 */ @@ -122,6 +127,7 @@ class Crud extends Command ->addOption('citysuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate citypicker component with suffix', null) ->addOption('selectpagesuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate selectpage component with suffix', null) ->addOption('selectpagessuffix', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'automatically generate multiple selectpage component with suffix', null) + ->addOption('ignorefields', null, Option::VALUE_OPTIONAL | Option::VALUE_IS_ARRAY, 'ignore fields', null) ->addOption('sortfield', null, Option::VALUE_OPTIONAL, 'sort field', null) ->addOption('editorclass', null, Option::VALUE_OPTIONAL, 'automatically generate editor class', null) ->setDescription('Build CRUD controller and model from table'); @@ -174,6 +180,8 @@ class Crud extends Command $selectpagesuffix = $input->getOption('selectpagesuffix'); //selectpage多选后缀 $selectpagessuffix = $input->getOption('selectpagessuffix'); + //排除字段 + $ignoreFields = $input->getOption('ignorefields'); //排序字段 $sortfield = $input->getOption('sortfield'); //编辑器Class @@ -196,6 +204,8 @@ class Crud extends Command $this->selectpageSuffix = $selectpagesuffix; if ($selectpagessuffix) $this->selectpagesSuffix = $selectpagessuffix; + if ($ignoreFields) + $this->ignoreFields = $ignoreFields; if ($editorclass) $this->editorClass = $editorclass; if ($sortfield) @@ -444,7 +454,7 @@ class Crud extends Command } $inputType = ''; //createtime和updatetime是保留字段不能修改和添加 - if ($v['COLUMN_KEY'] != 'PRI' && !in_array($field, $this->reservedField)) + if ($v['COLUMN_KEY'] != 'PRI' && !in_array($field, $this->reservedField) && !in_array($field, $this->ignoreFields)) { $inputType = $this->getFieldType($v); diff --git a/application/admin/command/Min.php b/application/admin/command/Min.php index d2fb4c62..cec70732 100644 --- a/application/admin/command/Min.php +++ b/application/admin/command/Min.php @@ -57,8 +57,8 @@ class Min extends Command { if (IS_WIN) { - // Winsows下请手动配置配置该值,一般将该值配置为 '"C:/Program Files/nodejs/node.exe"',除非你的Node安装路径有变更 - $nodeExec = '"C:/Program Files/nodejs/node.exe"'; + // Winsows下请手动配置配置该值,一般将该值配置为 '"C:\Program Files\nodejs\node.exe"',除非你的Node安装路径有变更 + $nodeExec = '"C:\Program Files\nodejs\node.exe"'; } else { @@ -117,7 +117,7 @@ class Min extends Command $output->info("Compress " . $data["{$res}BaseName"] . ".{$res}"); // 执行压缩 - echo exec("{$nodeExec} {$minPath}r.js -o {$tempFile} >> {$minPath}node.log"); + echo exec("{$nodeExec} \"{$minPath}r.js\" -o \"{$tempFile}\" >> \"{$minPath}node.log\""); } } diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 73cf8058..4abe86f0 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -305,31 +305,15 @@ class Addon extends Backend { $offset = (int) $this->request->get("offset"); $limit = (int) $this->request->get("limit"); - $filter = $this->request->get("filter"); - $filter = (array) json_decode($filter, true); - foreach ($filter as $k => &$v) - { - $v = htmlspecialchars(strip_tags($v)); - } - unset($v); - $where = ['status' => 'normal']; - if (isset($filter['id'])) - { - $where['id'] = (int) $filter['id']; - } - if (isset($filter['name'])) - { - $where['name'] = ['like', "%{$filter['name']}%"]; - } - if (isset($filter['title'])) - { - $where['title'] = ['like', "%{$filter['title']}%"]; - } + $search = $this->request->get("search"); + $search = htmlspecialchars(strip_tags($search)); $addons = get_addon_list(); $list = []; foreach ($addons as $k => $v) { + if ($search && stripos($v['name'], $search) === FALSE && stripos($v['intro'], $search) === FALSE) + continue; $v['flag'] = ''; $v['banner'] = ''; $v['image'] = ''; @@ -340,8 +324,9 @@ class Addon extends Backend $v['createtime'] = 0; $list[] = $v; } + $total = count($list); $list = array_slice($list, $offset, $limit); - $result = array("total" => count($addons), "rows" => $list); + $result = array("total" => $total, "rows" => $list); $callback = $this->request->get('callback') ? "jsonp" : "json"; return $callback($result); diff --git a/application/admin/lang/zh-cn/addon.php b/application/admin/lang/zh-cn/addon.php index 7f3257ac..c7ad05e8 100644 --- a/application/admin/lang/zh-cn/addon.php +++ b/application/admin/lang/zh-cn/addon.php @@ -58,7 +58,6 @@ return [ 'Uninstall successful' => '卸载成功', 'Operate successful' => '操作成功', 'Addon info file was not found' => '插件配置文件未找到', - 'Addon info file data incorrect' => '插件配置文件未找到', 'Addon info file data incorrect' => '插件配置信息不正确', 'Addon already exists' => '上传的插件已经存在', ]; diff --git a/application/admin/lang/zh-cn/auth/rule.php b/application/admin/lang/zh-cn/auth/rule.php index 5493d3f7..574be8a6 100644 --- a/application/admin/lang/zh-cn/auth/rule.php +++ b/application/admin/lang/zh-cn/auth/rule.php @@ -6,10 +6,12 @@ return [ 'Remark' => '备注', 'Icon' => '图标', 'Alert' => '警告', - 'Name' => '规则URL', + 'Name' => '规则', 'Controller/Action' => '控制器名/方法名', 'Ismenu' => '菜单', 'Search icon' => '搜索图标', + 'Menu tips' => '规则任意,不可重复,仅做层级显示,无需匹配控制器和方法', + 'Node tips' => '控制器/方法名', 'The non-menu rule must have parent' => '非菜单规则节点必须有父级', 'If not necessary, use the command line to build rule' => '非必要情况下请直接使用命令行php think menu来生成', 'Name only supports letters, numbers, underscore and slash' => 'URL规则只能是小写字母、数字、下划线和/组成', diff --git a/application/admin/view/auth/rule/add.html b/application/admin/view/auth/rule/add.html index 7f808a3c..c9a8e1aa 100644 --- a/application/admin/view/auth/rule/add.html +++ b/application/admin/view/auth/rule/add.html @@ -12,13 +12,13 @@
Blue
Black
White
Purple
Green
Red
Yellow
Blue Light
Black Light
White Light
Purple Light
Green Light
Red Light
© 2017 FastAdmin. All Rights Reserved.