1
0
Files
helper/application/common/service/Logs.php
2020-08-06 14:58:51 +08:00

31 lines
992 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\service;
use app\common\model\Logs as LogsModel;
class Logs extends _Init
{
/**
* 写入日志
* @param string $logs 日志内容
* @param array $data 操作数据
* @param boolean|integer $uid boolean 自动记录当前用户 integer 指定用户UID
*/
public static function write($logs, $data = [], $uid = true)
{
$save = [
'uid' => $uid === true ? Member::isLogin() : $uid,
'logs' => $logs,
'datas' => $data,
];
LogsModel::create($save);
}
}