1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Servers\Logs;
- use App\Models\SysModels\AdminLog;
- use App\Servers\Common\CommonServer;
- class AdminLogsServer
- {
- /**
- * 后台日志记录
- * @param string $msg
- * @param string $u_id
- * @return mixed
- */
- static public function write($msg='',$u_id='')
- {
- $url = request()->url();
- $data=request()->all();
- $ip = CommonServer::creatServer()->getClientIp();
- return AdminLog::create(
- [
- 'u_id' => $u_id,
- 'url' => $url,
- 'msg' => $msg,
- 'ip' => $ip,
- 'data' => http_build_query($data),
- ]
- );
- }
- }
|