|
|
@ -2208,4 +2208,112 @@ function a_array_unique($array){
|
|
|
|
return $data;
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 操作日志
|
|
|
|
|
|
|
|
* array(
|
|
|
|
|
|
|
|
* op_type=>操作类型 0:新增,1:编辑 2:删除 3:下载,
|
|
|
|
|
|
|
|
* op_name=>操作说明 例如:编辑,删除,锁定等,
|
|
|
|
|
|
|
|
* url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面),
|
|
|
|
|
|
|
|
* key=>关键词:用户的账号,游戏的名词等,
|
|
|
|
|
|
|
|
* menu=>非必须,菜单目录,不存在的话按控制器寻找
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function addOperationLog($options)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$checkarr = ['op_type','url','key'];
|
|
|
|
|
|
|
|
foreach ($checkarr as $v) {
|
|
|
|
|
|
|
|
if(!array_key_exists($v,$options)){
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!array_key_exists("op_name",$options)){
|
|
|
|
|
|
|
|
$options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :($options['op_type'] == 3 ? "导出" :"新增")));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取ip
|
|
|
|
|
|
|
|
$addarray = [
|
|
|
|
|
|
|
|
"op_ip"=>$_SERVER['REMOTE_ADDR'],
|
|
|
|
|
|
|
|
'admin_id'=>$_SESSION['onethink_admin']['user_auth']['uid'],
|
|
|
|
|
|
|
|
'admin_account'=>$_SESSION['onethink_admin']['user_auth']['username'],
|
|
|
|
|
|
|
|
'op_type'=>$options['op_type'],
|
|
|
|
|
|
|
|
'op_name'=>$options['op_name'],
|
|
|
|
|
|
|
|
'url'=>$options['url'],
|
|
|
|
|
|
|
|
'key'=>$options['key'],
|
|
|
|
|
|
|
|
'create_time'=>time()
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
//获取菜单名称
|
|
|
|
|
|
|
|
if(!array_key_exists("menu",$options)){
|
|
|
|
|
|
|
|
$act = CONTROLLER_NAME.'/'.ACTION_NAME;
|
|
|
|
|
|
|
|
$arr = [];
|
|
|
|
|
|
|
|
$menuname = D("menu")->field('title,pid,group')->where("url = '{$act}'")->find();
|
|
|
|
|
|
|
|
if($menuname){
|
|
|
|
|
|
|
|
$arr[] = $menuname['title'];
|
|
|
|
|
|
|
|
if(!empty($menuname['group'])){
|
|
|
|
|
|
|
|
$arr[] = $menuname['group'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getLink($menuname['pid'],$arr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$addarray['menu'] = implode ( "-",array_reverse($arr));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$addarray['menu'] = $options['menu'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M("OperationLog","tab_")->add($addarray);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getLink($pid=0,&$arr){
|
|
|
|
|
|
|
|
if($pid == 0){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$menuname = D("menu")->field('title,pid,group')->where("id = '{$pid}'")->find();
|
|
|
|
|
|
|
|
if($menuname){
|
|
|
|
|
|
|
|
$arr[] = $menuname['title'];
|
|
|
|
|
|
|
|
if(!empty($menuname['group'])){
|
|
|
|
|
|
|
|
$arr[] = $menuname['group'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if($menuname['pid'] != 0){
|
|
|
|
|
|
|
|
getLink($menuname['pid'], $arr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getNowDate() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return date('YmdHis',time());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据推广员id获取推广员姓名
|
|
|
|
|
|
|
|
function getPromoteName($id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$id) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$name = M('promote','tab_')
|
|
|
|
|
|
|
|
->where(['id'=>$id])
|
|
|
|
|
|
|
|
->find()['account'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据关联id获取游戏名称
|
|
|
|
|
|
|
|
function getrelationGameName($id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$id) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$name = M('game','tab_')
|
|
|
|
|
|
|
|
->where(['relation_game_id'=>$id])
|
|
|
|
|
|
|
|
->find()['relation_game_name'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|