public function logList() { $searchNickname = ""; $searchModule = ""; $startTime = ""; $endTime = ""; $searchNickname = I("searchNickname"); $searchTime = I("searchTime"); $type = I("type"); if (!$searchTime) { $searchTime = date('Y-m-d') . "__" . date('Y-m-d'); } $log = new LogModel(); $list = $log->logList($searchNickname, $searchTime); if ("searchLog" == $type) { $list = json_encode($list, true); echo $list; exit; } $this->assign('logList', $list['logList']); $this->assign('searchNickname', $searchNickname); $this->assign('searchTime', $searchTime); $this->assign('page', $list['show']); $this->display(); }
public function saveLog() { // $self_url = str_replace("index.php/", "", $self_url); // $self_url = ltrim($self_url,"/"); // module 业务名称 action 业务模块 function 操作 // list (,$module, $action,$function) = explode('/', $self_url); $module = MODULE_NAME; $action = CONTROLLER_NAME; $function = ACTION_NAME; $this->getNowPath(); $parameter = array("get" => $_GET, "post" => $_POST); $parameter = json_encode($parameter, true); $loginUserName = $_SESSION['loginUserName']; $uid = $_SESSION['authId']; $data['user_id'] = $uid; $data['nickname'] = $loginUserName; $data['module'] = $module; $data['action'] = $action; $data['function'] = $function; $data['ctime'] = date("Y-m-d H:i:s"); $data['parameter'] = $parameter; $log = new LogModel(); $log->addLog($data); }