ZjMsgController.php 877 字节
<?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('删除失败');
            }
        }
    }


}