diff --git a/application/admin/command/Menu.php b/application/admin/command/Menu.php index ad18b89c..e65c4123 100755 --- a/application/admin/command/Menu.php +++ b/application/admin/command/Menu.php @@ -27,7 +27,7 @@ class Menu extends Command ->addOption('force', 'f', Option::VALUE_OPTIONAL, 'force delete menu,without tips', null) ->addOption('equal', 'e', Option::VALUE_OPTIONAL, 'the controller must be equal', null) ->setDescription('Build auth menu from controller'); - //要执行的controller必须一样,不适用模糊查询 + //要执行的controller必须一样,不适用模糊查询 } protected function execute(Input $input, Output $output) @@ -44,7 +44,7 @@ class Menu extends Command //是否为删除模式 $delete = $input->getOption('delete'); //是否控制器完全匹配 - $equal= $input->getOption('equal'); + $equal = $input->getOption('equal'); if ($delete) { @@ -54,10 +54,10 @@ class Menu extends Command $ids = []; $list = $this->model->where(function ($query) use ($controller, $equal) { foreach ($controller as $index => $item) { - if($equal) + if ($equal) $query->whereOr('name', 'eq', $item); else - $query->whereOr('name', 'like', strtolower($item) . "%"); + $query->whereOr('name', 'like', strtolower($item) . "%"); } })->select(); foreach ($list as $k => $v) { @@ -156,6 +156,7 @@ class Menu extends Command protected function importRule($controller) { + $controller = str_replace('\\', '/', $controller); $controllerArr = explode('/', $controller); end($controllerArr); $key = key($controllerArr); diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 4e3dd473..560f5138 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -82,7 +82,9 @@ class Addon extends Backend $this->error(__('Parameter %s can not be empty', '')); } $this->view->assign("addon", ['info' => $info, 'config' => $config]); - return $this->view->fetch(); + $configFile = ADDON_PATH . $name . DS . 'config.html'; + $viewFile = is_file($configFile) ? $configFile : ''; + return $this->view->fetch($viewFile); } /** diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php index d2ca90a6..80414dfc 100644 --- a/application/admin/controller/general/Attachment.php +++ b/application/admin/controller/general/Attachment.php @@ -31,22 +31,35 @@ class Attachment extends Backend { //设置过滤方法 $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { + if ($this->request->isAjax()) { + $mimetypeQuery = []; + $filter = $this->request->request('filter'); + $filterArr = (array)json_decode($filter, TRUE); + if (isset($filterArr['mimetype']) && stripos($filterArr['mimetype'], ',') !== false) { + $this->request->get(['filter' => json_encode(array_merge($filterArr, ['mimetype' => '']))]); + $mimetypeQuery = function ($query) use ($filterArr) { + $mimetypeArr = explode(',', $filterArr['mimetype']); + foreach ($mimetypeArr as $index => $item) { + $query->whereOr('mimetype', 'like', '%' . $item . '%'); + } + }; + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); + ->where($mimetypeQuery) + ->where($where) + ->order($sort, $order) + ->count(); $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); + ->where($mimetypeQuery) + ->where($where) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root()); - foreach ($list as $k => &$v) - { + foreach ($list as $k => &$v) { $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; } unset($v); @@ -62,8 +75,7 @@ class Attachment extends Backend */ public function select() { - if ($this->request->isAjax()) - { + if ($this->request->isAjax()) { return $this->index(); } return $this->view->fetch(); @@ -74,8 +86,7 @@ class Attachment extends Backend */ public function add() { - if ($this->request->isAjax()) - { + if ($this->request->isAjax()) { $this->error(); } return $this->view->fetch(); @@ -87,18 +98,15 @@ class Attachment extends Backend */ public function del($ids = "") { - if ($ids) - { - \think\Hook::add('upload_delete', function($params) { + if ($ids) { + \think\Hook::add('upload_delete', function ($params) { $attachmentFile = ROOT_PATH . '/public' . $params['url']; - if (is_file($attachmentFile)) - { + if (is_file($attachmentFile)) { @unlink($attachmentFile); } }); $attachmentlist = $this->model->where('id', 'in', $ids)->select(); - foreach ($attachmentlist as $attachment) - { + foreach ($attachmentlist as $attachment) { \think\Hook::listen("upload_delete", $attachment); $attachment->delete(); } diff --git a/application/admin/lang/zh-cn/general/attachment.php b/application/admin/lang/zh-cn/general/attachment.php index b713a4d0..96ea7af7 100644 --- a/application/admin/lang/zh-cn/general/attachment.php +++ b/application/admin/lang/zh-cn/general/attachment.php @@ -2,6 +2,8 @@ return [ 'Id' => 'ID', + 'Admin_id' => '管理员ID', + 'User_id' => '会员ID', 'Url' => '物理路径', 'Imagewidth' => '宽度', 'Imageheight' => '高度', diff --git a/application/admin/model/UserRule.php b/application/admin/model/UserRule.php index 07b64244..641d65b0 100644 --- a/application/admin/model/UserRule.php +++ b/application/admin/model/UserRule.php @@ -41,10 +41,9 @@ class UserRule extends Model public static function getTreeList($selected = []) { - $ruleList = collection(self::where('status', 'normal')->select())->toArray(); + $ruleList = collection(self::where('status', 'normal')->order('weigh desc,id desc')->select())->toArray(); $nodeList = []; - foreach ($ruleList as $k => $v) - { + foreach ($ruleList as $k => $v) { $state = array('selected' => $v['ismenu'] ? false : in_array($v['id'], $selected)); $nodeList[] = array('id' => $v['id'], 'parent' => $v['pid'] ? $v['pid'] : '#', 'text' => __($v['title']), 'type' => 'menu', 'state' => $state); } diff --git a/application/admin/view/addon/config.html b/application/admin/view/addon/config.html index ef050c15..327d83c8 100644 --- a/application/admin/view/addon/config.html +++ b/application/admin/view/addon/config.html @@ -15,10 +15,10 @@
{switch $item.type} {case string} - + {/case} {case text} - + {/case} {case array}
@@ -31,10 +31,10 @@
{/case} {case datetime} - + {/case} {case number} - + {/case} {case checkbox} {foreach name="item.content" item="vo"} @@ -48,7 +48,7 @@ {/case} {case value="select" break="0"}{/case} {case value="selects"} - {foreach name="item.content" item="vo"} {/foreach} diff --git a/application/admin/view/addon/index.html b/application/admin/view/addon/index.html index 75dee090..0d5756b1 100644 --- a/application/admin/view/addon/index.html +++ b/application/admin/view/addon/index.html @@ -56,6 +56,9 @@ .form-userinfo .breadcrumb { margin-bottom:10px; } + .btn-toggle { + padding:0; + }
diff --git a/application/admin/view/general/config/index.html b/application/admin/view/general/config/index.html index 44edef96..753a2859 100644 --- a/application/admin/view/general/config/index.html +++ b/application/admin/view/general/config/index.html @@ -45,13 +45,13 @@
{switch $item.type} {case string} - + {/case} {case text} - + {/case} {case editor} - + {/case} {case array}
@@ -64,10 +64,10 @@
{/case} {case datetime} - + {/case} {case number} - + {/case} {case checkbox} {foreach name="item.content" item="vo"} @@ -81,7 +81,7 @@ {/case} {case value="select" break="0"}{/case} {case value="selects"} - {foreach name="item.content" item="vo"} {/foreach} diff --git a/application/config.php b/application/config.php index 2838b036..47b3aac0 100755 --- a/application/config.php +++ b/application/config.php @@ -272,7 +272,7 @@ return [ //自动检测更新 'checkupdate' => false, //版本号 - 'version' => '1.0.0.20180806_beta', + 'version' => '1.0.0.20180911_beta', //API接口地址 'api_url' => 'https://api.fastadmin.net', ], diff --git a/application/index/controller/User.php b/application/index/controller/User.php index fe62e90f..c166476a 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -53,6 +53,17 @@ class User extends Frontend }); } + /** + * 空的请求 + * @param $name + * @return mixed + */ + public function _empty($name) + { + Hook::listen("user_request_empty", $name); + return $this->view->fetch('user/' . $name); + } + /** * 会员中心 */ diff --git a/application/index/lang/zh-cn.php b/application/index/lang/zh-cn.php index a2a5c6ad..c032c8d6 100755 --- a/application/index/lang/zh-cn.php +++ b/application/index/lang/zh-cn.php @@ -104,6 +104,7 @@ return [ 'Features' => '功能特性', 'Home' => '首页', 'Store' => '插件市场', + 'Wxapp' => '小程序', 'Services' => '服务', 'Download' => '下载', 'Demo' => '演示', diff --git a/application/index/view/common/meta.html b/application/index/view/common/meta.html index d75406ff..794db148 100644 --- a/application/index/view/common/meta.html +++ b/application/index/view/common/meta.html @@ -12,7 +12,7 @@ - + diff --git a/application/index/view/common/sidenav.html b/application/index/view/common/sidenav.html index 3902f350..e9b2a850 100644 --- a/application/index/view/common/sidenav.html +++ b/application/index/view/common/sidenav.html @@ -1,4 +1,5 @@
+ {:hook('user_sidenav_before')} + {:hook('user_sidenav_after')}
\ No newline at end of file diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index e7dd9314..0e454f7e 100755 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -41,6 +41,7 @@