<?php
namespace app\model;

class Log extends Base
{
    //记录操作日志
    public static function write($controller, $action, $content)
    {
        $auth = session('auth');
        return self::create([
            'member_id' => $auth['userId'],
            'name' => $auth['userName'],
            'ip' => request()->ip(),
            'create_time' => time(),
            'controller' => $controller,
            'action' => $action,
            'content' => $content
        ]);
    }
}