This commit is contained in:
2020-02-18 10:15:02 +08:00
parent 5fb45fc57c
commit d4325e3016
18 changed files with 194 additions and 159 deletions

View File

@@ -6,9 +6,11 @@
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\controller\admin;
use sent\tree\Tree;
use app\controller\Admin;
use app\model\Menu as MenuM;
/**
* @title 菜单管理
@@ -22,21 +24,19 @@ class Menu extends Admin {
/**
* @title 菜单列表
*/
public function index() {
public function index(MenuM $menu) {
$map = array();
$title = trim(input('get.title'));
$list = db("Menu")->where($map)->field(true)->order('sort asc,id asc')->column('*', 'id');
int_to_string($list, array('hide' => array(1 => '是', 0 => '否'), 'is_dev' => array(1 => '是', 0 => '否')));
$list = $menu->where($map)->field(true)->order('sort asc,id asc')->select();
// int_to_string($list, array('hide' => array(1 => '是', 0 => '否'), 'is_dev' => array(1 => '是', 0 => '否')));
if (!empty($list)) {
$tree = new \com\Tree();
$list = $tree->toFormatTree($list);
$list = (new Tree())->toFormatTree($list->append(['is_dev_text', 'hide_text'])->toArray());
}
// 记录当前列表页的cookie
Cookie('__forward__', $_SERVER['REQUEST_URI']);
// Cookie('__forward__', $_SERVER['REQUEST_URI']);
$this->setMeta('菜单列表');
$this->assign('list', $list);
$this->data['list'] = $list;
return $this->fetch();
}