function analyse_log($module, $code, $date, $condition) { //时间 if ($date) { extract($date); } if ('user' == $module) { $module = 'users'; $content = '顾客'; } elseif ('order' == $module) { $module = 'orders'; $content = '订单'; } if ($code == 'transfer') { /*指转移顾客数量*/ } else { $mem = new Memcache(); $mem->connect('127.0.0.1', 11211); //统计每个员工的对顾客的操作 //1、收集管理员id //2、统计操作了非属于自己顾客的操作次数 //3、某顾客类型次数、某平台、某等级、操作日志中顾客的购买力 if ($mem->get('log_list') && $mem->get('log_condition') == $condition) { $log_list = $mem->get('log_list'); } else { $result = get_admin_log(0, '', $module, $start_time, $end_time, ' do_times DESC', ''); $log_list = $result['log_list']; //if ($log_list) { // $admin_list = get_log_admin($log_list); // $un_i_do = get_un_i_do($admin_list,$log_list); //统计操作非自己顾客次数 // print_r($un_i_do); // //$mem->set('log_list',$log_list,0,3600); // //$mem->set('log_condition',$condition,0,3600); //} } } return $log_list; }
$adminname = trim($_GET['adminname']); require_once QISHI_ROOT_PATH . 'include/page.class.php'; if ($_SESSION['admin_purview'] == "all") { $wheresql = ""; } else { $wheresql = " WHERE admin_name='" . $_SESSION['admin_name'] . "'"; } if (!empty($_GET['log_type'])) { $wheresql = empty($wheresql) ? " WHERE log_type= " . intval($_GET['log_type']) : $wheresql . " AND log_type=" . intval($_GET['log_type']); } $total_sql = "SELECT COUNT(*) AS num FROM " . table('admin_log') . $wheresql; $total_val = $db->get_total($total_sql); $page = new page(array('total' => $total_val, 'perpage' => $perpage, 'getarray' => $_GET)); $currenpage = $page->nowindex; $offset = ($currenpage - 1) * $perpage; $list = get_admin_log($offset, $perpage, $wheresql); $smarty->assign('pageheader', "登录日志"); $smarty->assign('list', $list); //列表 $smarty->assign('perpage', $perpage); //每页显示数量POST if ($total_val > $perpage) { $smarty->assign('page', $page->show(3)); //分页符 } $smarty->display('users/admin_users_log.htm'); } elseif ($act == 'users_set') { get_token(); $id = intval($_GET['id']); $account = get_admin_account($id); $smarty->assign('account', $account);
<?php // configuration require_once "../includes/config.php"; $log = get_admin_log(); render_mult(["admin_common.php", "admin_log.php"], ["title" => $title . " - Admin Log", "log" => $log]);