getContent($argv[1]); } if ($content == '') return; $data = [ 'employee_id' => $employee->id, 'root_id' => $employee->root_id, 'ip' => request()->ip(), 'content' => $content, 'addtime' => date('Y-m-d H:i:s') ]; ModelOperateLog::create($data); } /** * 获取登录内容 */ public function getContent($obj) { $classNameSpace = get_class($obj); $path = explode('\\', $classNameSpace); $type = lcfirst(array_pop($path)); $method = 'get' . ucfirst($type) . 'Content'; if (method_exists($this, $method)) { return $this->$method(); } return ''; } }