功能更新
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\model\AdPlace;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
@@ -16,31 +17,19 @@ use app\controller\Admin;
|
||||
*/
|
||||
class Ad extends Admin {
|
||||
|
||||
protected $ad;
|
||||
protected $adplace;
|
||||
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
$this->ad = db('Ad');
|
||||
$this->adplace = db('AdPlace');
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 广告位管理
|
||||
*/
|
||||
public function index() {
|
||||
$map = array();
|
||||
$map = [];
|
||||
$order = "id desc";
|
||||
|
||||
$list = db('AdPlace')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$data = array(
|
||||
$list = AdPlace::where($map)->order($order)->paginate($this->request->pageConfig);
|
||||
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta("广告管理");
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\AuthGroup;
|
||||
use app\model\AuthRule;
|
||||
|
||||
/**
|
||||
* @title 用户组管理
|
||||
@@ -16,32 +18,21 @@ use app\controller\Admin;
|
||||
*/
|
||||
class Group extends Admin {
|
||||
|
||||
protected $model;
|
||||
protected $rule;
|
||||
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
$this->group = model('AuthGroup');
|
||||
$this->rule = model('AuthRule');
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 用户组列表
|
||||
*/
|
||||
public function index($type = 'admin') {
|
||||
$map['module'] = $type;
|
||||
$map = [];
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$map[] = ['module', '=', $type];
|
||||
|
||||
$data = array(
|
||||
$list = AuthGroup::where($map)->order('id desc')->paginate($this->request->pageConfig);
|
||||
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
'type' => $type,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('用户组管理');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
@@ -128,19 +119,17 @@ class Group extends Admin {
|
||||
* @title 权限节点
|
||||
*/
|
||||
public function access($type = 'admin') {
|
||||
$map['module'] = $type;
|
||||
$map = [];
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(15, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$map[] = ['module', '=', $type];
|
||||
|
||||
$data = array(
|
||||
$list = AuthRule::where($map)->order('id desc')->paginate($this->request->pageConfig);
|
||||
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
'type' => $type,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('权限节点');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user