ZjMsgController.php
877 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Created by PhpStorm.
* User: wz
* Date: 2018/9/20
* Time: 15:33
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
class ZjMsgController extends AdminBaseController
{
public function index(){
$all=Db::name('zj_msg')->alias('m')->join('user u','m.uid=u.id')
->field('u.user_nickname,u.mobile,m.*')->order('create_time','desc')->paginate('15');
$this->assign('page',$all->render());
$this->assign('all',$all->items());
return $this->fetch();
}
public function delete(){
if ($this->request->isAjax()){
$id=input('param.id');
$del=Db::name('zj_msg')->delete($id);
if ($del){
$this->success('删除成功');
}else{
$this->error('删除失败');
}
}
}
}