47 行
1.4 KiB
PHP
可执行文件
47 行
1.4 KiB
PHP
可执行文件
<?php
|
|
namespace Admin\Controller;
|
|
use Think\Controller;
|
|
//[1.5.84]
|
|
class InformationController extends BaseController{
|
|
public function index(){
|
|
$arr = array(
|
|
'delUser' => '/index.php/Admin/Information/delUser', //删除网站消息
|
|
);
|
|
$authArr = checkFunction($arr);
|
|
$this->assign('authArr', $authArr);
|
|
$this->display();
|
|
}
|
|
|
|
// 删除信息
|
|
public function delUser(){
|
|
$id = I('post.id');
|
|
$list = M("retail_information")->where(array('id'=>$id))->delete();
|
|
if ($list){
|
|
$res['status'] = 1;
|
|
$res['msg'] = "删除成功";
|
|
}else{
|
|
$res['status'] = 0;
|
|
$res['msg'] = "删除失败";
|
|
}
|
|
$this->ajaxReturn($res);
|
|
}
|
|
/**
|
|
* 获取表单数据
|
|
*/
|
|
public function getData(){
|
|
$user = session('admin_userinfo');
|
|
$news['pid'] = $user['pid'];
|
|
$list = M("retail_information")->where($news)->page($_POST['page'],$_POST['limit'])->order('addtime desc')->select();
|
|
foreach ($list as $key=>&$val)
|
|
{
|
|
$val['addtime'] = date('Y-m-d H:i:s',$val['addtime']);
|
|
}
|
|
$count = count(M("retail_information")->where($news)->select());
|
|
$res['code'] = 0;
|
|
$res['msg'] = '';
|
|
$res['data'] = $list;
|
|
$res['count'] = $count;
|
|
$this->ajaxReturn($res);
|
|
|
|
}
|
|
} |