isAjax()) { $param = get_params(); $where = array(); if (!empty($param['keywords'])) { $where[] = ['nickname|content|param_id', 'like', '%' . $param['keywords'] . '%']; } if (!empty($param['action'])) { $where['action'] = $param['action']; } $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $content = DB::name('AdminLog') ->field("id,uid,nickname,action,title,content,rule_menu,ip,param_id,param,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time") ->order('create_time desc') ->where($where) ->paginate($rows, false, ['query' => $param]); $content->toArray(); foreach ($content as $k => $v) { $data = $v; $param_array = json_decode($v['param'], true); if(is_array($param_array)){ $param_value = ''; foreach ($param_array as $key => $value) { if (is_array($value)) { $value = implode(',', $value); } $param_value .= $key . ':' . $value . '  |  '; } $data['param'] = $param_value; } else{ $data['param'] = $param_array; } $content->offsetSet($k, $data); } return table_assign(0, '', $content); } else { $type_action = get_config('log.admin_action'); View::assign('type_action', $type_action); return view(); } } }