<?php
namespace app\index\controller;
use think\facade\View;
use think\facade\Session;
use app\common\variable\MsgCode as MsgCode;
use app\common\model\UserLoginLog as UserLoginLog;
class Log extends Base
{
    public function getLoginLog()
    {
        if (request()->isAjax()) {
            $Log=UserLoginLog::alias('log')->where(['log.uid'=>Session::get('User.id')])
                ->join('api_app app','app.app_id=log.appid')
                ->order('log.id desc')->field('log.*,app.app_name')->paginate(15);
            if($Log->items()){
                return $this->ajaxReturn('success',MsgCode::$success,$Log);
            }else{
                return $this->ajaxReturn('暂无数据~',MsgCode::$error);
            }
        }
    }
}
