更新
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 友情链接
|
||||
@@ -23,9 +23,9 @@ class Link extends Admin {
|
||||
$map = array();
|
||||
|
||||
$order = "id desc";
|
||||
$list = db('Link')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
$list = db('Link')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -64,13 +64,12 @@ class Link extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 修改链接
|
||||
*/
|
||||
public function edit() {
|
||||
$link = model('Link');
|
||||
$id = input('id', '', 'trim,intval');
|
||||
$id = input('id', '', 'trim,intval');
|
||||
if ($this->request->isPost()) {
|
||||
$data = input('post.');
|
||||
if ($data) {
|
||||
@@ -84,12 +83,12 @@ class Link extends Admin {
|
||||
return $this->error($link->getError());
|
||||
}
|
||||
} else {
|
||||
$map = array('id' => $id);
|
||||
$map = array('id' => $id);
|
||||
$info = db('Link')->where($map)->find();
|
||||
|
||||
$data = array(
|
||||
'keyList' => $link->keyList,
|
||||
'info' => $info,
|
||||
'info' => $info,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta("编辑友链");
|
||||
@@ -107,7 +106,7 @@ class Link extends Admin {
|
||||
}
|
||||
$link = db('Link');
|
||||
|
||||
$map = array('id' => array('IN', $id));
|
||||
$map = array('id' => array('IN', $id));
|
||||
$result = $link->where($map)->delete();
|
||||
if ($result) {
|
||||
return $this->success("删除成功!");
|
||||
|
||||
Reference in New Issue
Block a user