扩展功能优化完善

This commit is contained in:
2020-04-04 16:13:40 +08:00
parent ba37debc0e
commit 4e730d23fa
4 changed files with 100 additions and 14 deletions

View File

@@ -184,7 +184,7 @@ class Addons extends Base {
$map = [];
$order = "id desc";
$list = Hooks::where($map)->order($order)->paginate($this->request->pageConfig);
$list = Hooks::where($map)->order($order)->paginate($this->request->pageConfig)->append(['type_text']);
$this->data = array(
'list' => $list,
@@ -216,7 +216,6 @@ class Addons extends Base {
* @title 编辑钩子
*/
public function edithook($id) {
$hooks = model('Hooks');
if ($this->request->isPost()) {
$result = $hooks->change();
if ($result !== false) {
@@ -225,15 +224,13 @@ class Addons extends Base {
return $this->error($hooks->getError());
}
} else {
$info = db('Hooks')->find($id);
$keylist = $hooks->getaddons($info['addons']);
$data = array(
$info = Hooks::find($id);
$keylist = Hooks::getaddons($info);
$this->data = array(
'info' => $info,
'keyList' => $keylist,
);
$this->assign($data);
$this->setMeta('编辑钩子');
return $this->fetch('public/edit');
return $this->fetch('admin/public/edit');
}
}