<?php /** * Created by PhpStorm. * User: yhbr * Date: 2018/8/29 * Time: 11:21 */ namespace app\admin\controller; use cmf\controller\AdminBaseController; use think\Db; class MessageController extends AdminBaseController { public function index() { $res = Db::name('message')->alias('m') ->field('m.*,u.user_nickname') ->join('user u', 'u.id=m.user_id') ->order('add_time DESC') ->paginate(20); return $this->fetch('', [ 'mes' => $res ]); } }