本文整理汇总了PHP中SysLog::getLogs方法的典型用法代码示例。如果您正苦于以下问题:PHP SysLog::getLogs方法的具体用法?PHP SysLog::getLogs怎么用?PHP SysLog::getLogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SysLog
的用法示例。
在下文中一共展示了SysLog::getLogs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strtotime
$start_time = strtotime($start_date);
$end_time = strtotime($end_date);
//START 数据库查询及分页数据
if ($start_date != '' && $end_date != '') {
$row_count = SysLog::getCountByDate($class_name, $user_name, $start_time, $end_time);
} else {
$row_count = SysLog::count($class_name, $user_name);
}
$page_size = PAGE_SIZE;
$page_no = $page_no < 1 ? 1 : $page_no;
$total_page = $row_count % $page_size == 0 ? $row_count / $page_size : ceil($row_count / $page_size);
$total_page = $total_page < 1 ? 1 : $total_page;
$page_no = $page_no > $total_page ? $total_page : $page_no;
$start = ($page_no - 1) * $page_size;
//END
$sys_logs = SysLog::getLogs($class_name, $user_name, $start, $page_size, $start_time, $end_time);
$loadedClz = array();
$namePool = array();
foreach ($sys_logs as &$log) {
if (array_key_exists($log['action'], $OSADMIN_COMMAND_FOR_LOG)) {
$log['action'] = $OSADMIN_COMMAND_FOR_LOG[$log['action']];
}
$class_obj = $log['class_obj'];
if (array_key_exists($log['class_name'], $OSADMIN_CLASS_FOR_LOG)) {
$log['class_name'] = $OSADMIN_CLASS_FOR_LOG[$log['class_name']];
}
if ($log['class_obj'] == "") {
$log['class_obj'] = 'null';
}
if (empty($log['result'])) {
$log['result'] = '成功';