审查视图

app/admin/controller/MessageController.php 545 字节
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
<?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
        ]);
    }

}