更新代码,完善功能
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\Addons as AddonsM;
|
||||
use app\model\Hooks;
|
||||
|
||||
/**
|
||||
* @title 插件管理
|
||||
@@ -16,34 +18,19 @@ use app\controller\Admin;
|
||||
*/
|
||||
class Addons extends Admin {
|
||||
|
||||
protected $addons;
|
||||
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
//加入菜单
|
||||
$this->getAddonsMenu();
|
||||
$this->addons = model('Addons');
|
||||
$this->hooks = db('Hooks');
|
||||
}
|
||||
/**
|
||||
* @title 插件列表
|
||||
*/
|
||||
public function index($refresh = 0) {
|
||||
public function index(AddonsM $addons, $refresh = 0) {
|
||||
if ($refresh) {
|
||||
$this->addons->refresh();
|
||||
$addons->refresh();
|
||||
}
|
||||
$list = $this->addons->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
$list = $addons->order('id desc')->paginate($this->request->pageConfig);
|
||||
|
||||
$data = array(
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
);
|
||||
$this->setMeta("插件管理");
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
@@ -218,22 +205,15 @@ class Addons extends Admin {
|
||||
* @title 钩子列表
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
$map = array();
|
||||
$map = [];
|
||||
$order = "id desc";
|
||||
$list = model('Hooks')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
$list = Hooks::where($map)->order($order)->paginate($this->request->pageConfig);
|
||||
|
||||
$data = array(
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
);
|
||||
$this->setMeta("钩子管理");
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user