diff --git a/Application/Admin/Controller/AmericaIpForbitController.class.php b/Application/Admin/Controller/AmericaIpForbitController.class.php index 6f71f4f24..b43d6f323 100644 --- a/Application/Admin/Controller/AmericaIpForbitController.class.php +++ b/Application/Admin/Controller/AmericaIpForbitController.class.php @@ -18,6 +18,7 @@ class AmericaIpForbitController extends ThinkController } $map = []; + $map['type'] = 0; if ($_REQUEST['user_account']) { $map['user_account'] = ['like',"%{$_REQUEST['user_account']}%"]; @@ -67,6 +68,7 @@ class AmericaIpForbitController extends ThinkController ); $map = []; + $map['type'] = 0; if ($_REQUEST['user_account']) { $map['user_account'] = ['like',"%{$_REQUEST['user_account']}%"]; @@ -186,7 +188,7 @@ class AmericaIpForbitController extends ThinkController $id = I('id'); } - $is_del = $is_change = M('forbit_ip','tab_')->where(['id'=>['in',$id]])->delete(); + $is_del = $is_change = M('forbit_ip','tab_')->where(['id'=>['in',$id],'type'=>0])->delete(); if ($is_del) { $hav_firbit = M('forbit_ip','tab_')->where(['id'=>I('id')])->find(); @@ -222,7 +224,7 @@ class AmericaIpForbitController extends ThinkController $this->error('用户不存在'); } - $hav_firbit = M('forbit_ip','tab_')->where(['user_account'=>I('account')])->find(); + $hav_firbit = M('forbit_ip','tab_')->where(['user_account'=>I('account'),'type'=>0])->find(); if ($hav_firbit) { $this->error('该用户已添加封禁'); diff --git a/Application/Admin/Controller/AutoPackController.class.php b/Application/Admin/Controller/AutoPackController.class.php index e7da748cd..59eb2715e 100644 --- a/Application/Admin/Controller/AutoPackController.class.php +++ b/Application/Admin/Controller/AutoPackController.class.php @@ -21,6 +21,7 @@ use BaiduBce\Log\LogFactory; use Think\Think; use Base\Service\GameSourceService; use Base\Tool\Printer; +use Base\Tool\Redis; /** * 后台首页控制器 @@ -39,21 +40,34 @@ class AutoPackController extends Think public function package() { - $find_web_stie = M('config') - -> field('value') - -> where(['name' => 'WEB_SITE']) - -> find(); + $find_web_stie = M('config')->field('value')->where(['name' => 'WEB_SITE'])->find(); if (null == $find_web_stie) { \Think\Log ::record('请先到站点->网站设置->网站域名处设置官网域名'); exit; } + $progressLimit = C('PACK_PROGRESS_LIMIT', null, 1); + $currentProgress = Redis::incr('console_packing'); + $progressId = date('His') . rand(100, 999) . $currentProgress; + if ($currentProgress > $progressLimit) { + Redis::decr('console_packing'); + Printer::export('打包进程已满,进程数量限制[' . $progressLimit . ']', true); + } + + Printer::export('打包进程[' . $progressId . ']开始'); + $this->checkPackageStatus(); // $this->app_package();//app渠道自动打包 - $this->channel(); + $result = $this->channel($progressId); // $this->launch_package(false); // $this->leak_detection(); + Redis::decr('console_packing'); + $message = '打包进程[' . $progressId . ']结束。' + . '处理数量[' . $result['total'] . '],' + . '成功数量[' . $result['success'] . '],' + . '失败数量[' . $result['error'] . ']'; + Printer::export($message); } /** @@ -293,7 +307,7 @@ class AutoPackController extends Think /** * 渠道游戏打包 */ - private function channel() { + private function channel($progressId = 0) { $map = []; $map['status'] = 1; $map['enable_status'] = ['in', '0,2']; @@ -304,8 +318,13 @@ class AutoPackController extends Think ->limit(15) ->select(); + $packResult = [ + 'total' => 0, + 'success' => 0, + 'error' => 0, + ]; if (count($applys) == 0) { - Printer::export('无等待队列', true); + return $packResult; } $applyIds = array_column($applys, 'id'); @@ -329,15 +348,19 @@ class AutoPackController extends Think $game = $games[$apply['game_id']]; $launchCount = $launchCountList[$apply['id']] ?? 0; $result = $gameSourceService->channelPack($gameSource, $game, $apply, $launchCount); - $message = '游戏['. $apply['game_id'] . '],渠道['. $apply['promote_id'] . ']打包,'; + $message = '进程[' . $progressId . '],游戏['. $apply['game_id'] . '],渠道['. $apply['promote_id'] . ']打包,'; + $packResult['total'] += 1; if ($result['status']) { $message = 'SUCCESS ----- ' . $message . $result['message']; + $packResult['success'] += 1; } else { $message = 'ERROR ----- ' . $message . $result['message']; + $packResult['error'] += 1; } Printer::export($message); } } + return $packResult; } diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 9ba943f92..62bd5671e 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -65,6 +65,7 @@ class MendController extends ThinkController { } elseif (isset($_REQUEST['time_end'])) { $map['order_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399]; } + $show_data_power = (is_administrator()|| session('user_auth')['show_data']); //为数据权限添加 setPowerPromoteIds($map); $data = M("Mend","tab_") @@ -81,6 +82,9 @@ class MendController extends ThinkController { foreach ($data as $key => $value) { $data[$key]['create_time'] = date("Y-m-d H:i:s",$value['create_time']); $data[$key]['order_time'] = date("Y-m-d H:i:s",$value['order_time']); + if(!$show_data_power){ + $data[$key]['user_account'] = encryptStr($data[$key]['user_account']); + } } if($export) db2csv($data,"推广员管理_推广补链_补链记录",["玩家账号","补链前渠道","补链前归属金额","补链后渠道","切分时间","补链时间","操作人员","备注"]); @@ -102,7 +106,7 @@ class MendController extends ThinkController { $page = set_pagination($count,$row); if($page) {$this->assign('_page', $page);} - $show_data_power = (is_administrator()|| session('user_auth')['show_data']); + $this->assign('show_data_power', $show_data_power); $this->display(); // parent::lists("Mend",$p,$map); diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index bc64845a7..4141db0c9 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1428,7 +1428,7 @@ class PromoteController extends ThinkController } $data = array( 'promote_id' => $promote_id, - 'company_belong' => $company_belong, + // 'company_belong' => $company_belong, 'company_relation' => $company_relation, 'can_view_recharge' => $can_view_recharge, 'company_type' => $company_type, @@ -1471,7 +1471,6 @@ class PromoteController extends ThinkController } $data = array( 'promote_id' => $promote_id, - // 'company_belong' => $company_belong, 'company_relation' => $company_relation, 'can_view_recharge' => $can_view_recharge, 'company_type' => $company_type, @@ -1521,7 +1520,6 @@ class PromoteController extends ThinkController $promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select(); foreach ($promote_belongs as $promote_belong) { $update = [ - 'company_belong' => $promote_belong['company_belong'], 'company_relation' => $promote_belong['company_relation'], 'can_view_recharge' => $promote_belong['can_view_recharge'], 'account_type' => $promote_belong['company_type'] diff --git a/Application/Admin/Controller/TestIpWhiteListController.class.php b/Application/Admin/Controller/TestIpWhiteListController.class.php new file mode 100644 index 000000000..ef687cbca --- /dev/null +++ b/Application/Admin/Controller/TestIpWhiteListController.class.php @@ -0,0 +1,216 @@ +where($map) + ->page($page,$row) + ->order('create_time DESC') + ->select(); + + foreach ( $data as $key => $value ) { + + $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); + + } + + $count = M('forbit_ip','tab_') + ->where($map) + ->count(); + + $appleInteriorBuyStatus = M('tool','tab_')->where(['name'=>'apple_interior_buy'])->getField('status'); + + $setAppleInteriorBuyStatus = $appleInteriorBuyStatus?1:0; + + $this->checkListOrCountAuthRestMap($map,[]); + + $page = set_pagination($count, $row); + + $this->assign('_page', $page); + + $this->assign('apple_interior_buy',$appleInteriorBuyStatus); + $this->assign('set_apple_interior_buy',$setAppleInteriorBuyStatus); + + $this->assign('data',$data); + + $this->display(); + + } + + public function export() { + + $xlsName = '苹果第三方支付开放名单'; + + $xlsCell = array( + "玩家账号", '添加人', '添加时间' + ); + + $map = []; + $map['type'] = 2; + + if ($_REQUEST['user_account']) { + $map['user_account'] = ['like',"%{$_REQUEST['user_account']}%"]; + } + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum = M('forbit_ip','tab_') + ->where($map) + ->count(); + + $accessNum =$accessNum['count']; + + $perSize = 2000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + + for($i = 1; $i <= $pages; $i++) { + $xlsData = M('forbit_ip','tab_') + ->field('user_account,admin_account,create_time') + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('create_time DESC') + ->select(); + + foreach($xlsData as $value) { + $value['create_time'] = date("Y-m-d H:i:s",$value['create_time']); + +// if ($value['status'] == 0) { +// $value['status'] = '限制'; +// } else { +// $value['status'] = '不限制'; +// } + + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + + addOperationLog(array( + "op_type"=>3, + "key"=> getNowDate(), + "menu"=>"游戏-游戏管理-ip测试白名单-导出", + "url"=>U("ThirdPartyIp/index") + )); + + $getData = $_GET; + unset($getData['id']); + unset($getData['xlsname']); + + } + + public function del() { + + if (!I('id')) { + $this->ajaxReturn(['code'=>1,'msg'=>'ID未选择']); + } else { + $id = I('id'); + } + + $is_del = $is_change = M('forbit_ip','tab_')->where(['id'=>['in',$id],'type'=>2])->delete(); + + if ($is_del) { + $hav_firbit = M('forbit_ip','tab_')->where(['id'=>I('id')])->find(); + addOperationLog(array( + "op_type"=>2, + "key"=> I('id'), + "menu"=>"游戏-游戏管理-ip测试白名单-删除", + "url"=>U("ThirdPartyIp/index") + )); + + $this->ajaxReturn(['code'=>1]); + } else { + $this->ajaxReturn(['code'=>0]); + } + + } + + public function add() { + + $this->display(); + + } + + public function addUser() { + + $insert = []; + + $hav_user = M('user','tab_')->where(['account'=>I('account')])->find(); + + $auth = $_SESSION['onethink_admin']['user_auth']; + + if (!$hav_user) { + $this->error('用户不存在'); + } + + $hav_firbit = M('forbit_ip','tab_')->where(['user_account'=>I('account'),'type'=>2])->find(); + + if ($hav_firbit) { + $this->error('该用户已添加封禁'); + } + + $insert['user_id'] = $hav_user['id']; + $insert['type'] = 2; + $insert['user_account'] = I('account'); + $insert['status'] = I('status'); + $insert['admin_id'] = $auth['uid']; + $insert['admin_account'] = $auth['username']; + $insert['create_time'] = time(); + $insert['remarks'] = ''; + + $is_insert = M('forbit_ip','tab_')->add($insert); + + if ($is_insert) { + + addOperationLog(array( + "op_type"=>0, + "key"=> I('account'), + "menu"=>"游戏-游戏管理-ip测试白名单-新增", + "url"=>U("ThirdPartyIp/index") + )); + + $this->success('添加成功',U('index')); + } else { + $this->error('添加失败'); + } + + } + + +} \ No newline at end of file diff --git a/Application/Admin/Controller/ThirdPartyIpController.class.php b/Application/Admin/Controller/ThirdPartyIpController.class.php new file mode 100644 index 000000000..154f323e7 --- /dev/null +++ b/Application/Admin/Controller/ThirdPartyIpController.class.php @@ -0,0 +1,216 @@ +where($map) + ->page($page,$row) + ->order('create_time DESC') + ->select(); + + foreach ( $data as $key => $value ) { + + $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); + + } + + $count = M('forbit_ip','tab_') + ->where($map) + ->count(); + + $appleInteriorBuyStatus = M('tool','tab_')->where(['name'=>'apple_interior_buy'])->getField('status'); + + $setAppleInteriorBuyStatus = $appleInteriorBuyStatus?1:0; + + $this->checkListOrCountAuthRestMap($map,[]); + + $page = set_pagination($count, $row); + + $this->assign('_page', $page); + + $this->assign('apple_interior_buy',$appleInteriorBuyStatus); + $this->assign('set_apple_interior_buy',$setAppleInteriorBuyStatus); + + $this->assign('data',$data); + + $this->display(); + + } + + public function export() { + + $xlsName = '苹果第三方支付开放名单'; + + $xlsCell = array( + "玩家账号", '添加人', '添加时间' + ); + + $map = []; + $map['type'] = 1; + + if ($_REQUEST['user_account']) { + $map['user_account'] = ['like',"%{$_REQUEST['user_account']}%"]; + } + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum = M('forbit_ip','tab_') + ->where($map) + ->count(); + + $accessNum =$accessNum['count']; + + $perSize = 2000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + + for($i = 1; $i <= $pages; $i++) { + $xlsData = M('forbit_ip','tab_') + ->field('user_account,admin_account,create_time') + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('create_time DESC') + ->select(); + + foreach($xlsData as $value) { + $value['create_time'] = date("Y-m-d H:i:s",$value['create_time']); + +// if ($value['status'] == 0) { +// $value['status'] = '限制'; +// } else { +// $value['status'] = '不限制'; +// } + + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + + addOperationLog(array( + "op_type"=>3, + "key"=> getNowDate(), + "menu"=>"游戏-游戏管理-ip限制白名单-导出", + "url"=>U("ThirdPartyIp/index") + )); + + $getData = $_GET; + unset($getData['id']); + unset($getData['xlsname']); + + } + + public function del() { + + if (!I('id')) { + $this->ajaxReturn(['code'=>1,'msg'=>'ID未选择']); + } else { + $id = I('id'); + } + + $is_del = $is_change = M('forbit_ip','tab_')->where(['id'=>['in',$id],'type'=>1])->delete(); + + if ($is_del) { + $hav_firbit = M('forbit_ip','tab_')->where(['id'=>I('id')])->find(); + addOperationLog(array( + "op_type"=>2, + "key"=> I('id'), + "menu"=>"游戏-游戏管理-ip限制白名单-删除", + "url"=>U("ThirdPartyIp/index") + )); + + $this->ajaxReturn(['code'=>1]); + } else { + $this->ajaxReturn(['code'=>0]); + } + + } + + public function add() { + + $this->display(); + + } + + public function addUser() { + + $insert = []; + + $hav_user = M('user','tab_')->where(['account'=>I('account')])->find(); + + $auth = $_SESSION['onethink_admin']['user_auth']; + + if (!$hav_user) { + $this->error('用户不存在'); + } + + $hav_firbit = M('forbit_ip','tab_')->where(['user_account'=>I('account'),'type'=>1])->find(); + + if ($hav_firbit) { + $this->error('该用户已添加封禁'); + } + + $insert['user_id'] = $hav_user['id']; + $insert['type'] = 1; + $insert['user_account'] = I('account'); + $insert['status'] = I('status'); + $insert['admin_id'] = $auth['uid']; + $insert['admin_account'] = $auth['username']; + $insert['create_time'] = time(); + $insert['remarks'] = ''; + + $is_insert = M('forbit_ip','tab_')->add($insert); + + if ($is_insert) { + + addOperationLog(array( + "op_type"=>0, + "key"=> I('account'), + "menu"=>"游戏-游戏管理-ip限制白名单-新增", + "url"=>U("ThirdPartyIp/index") + )); + + $this->success('添加成功',U('index')); + } else { + $this->error('添加失败'); + } + + } + + +} \ No newline at end of file diff --git a/Application/Admin/View/Mend/recordList.html b/Application/Admin/View/Mend/recordList.html index 189d2334f..14bf92805 100644 --- a/Application/Admin/View/Mend/recordList.html +++ b/Application/Admin/View/Mend/recordList.html @@ -150,13 +150,7 @@ {@each list_data as item,index} - - - {$data['user_account']} - - {$data['user_account']|encryptStr} - - + ${item['user_account']} ${item['promote_account']} ${item['pay_amount']} ${item['promote_account_to']} diff --git a/Application/Admin/View/Promote/belong_add.html b/Application/Admin/View/Promote/belong_add.html index 99ad10e4e..1ee1c9ac1 100644 --- a/Application/Admin/View/Promote/belong_add.html +++ b/Application/Admin/View/Promote/belong_add.html @@ -58,30 +58,6 @@ - - - - 工会归属: - - - - - - - - - 工会关系: diff --git a/Application/Admin/View/Promote/belong_edit.html b/Application/Admin/View/Promote/belong_edit.html index a6c26f438..4ca4c353b 100644 --- a/Application/Admin/View/Promote/belong_edit.html +++ b/Application/Admin/View/Promote/belong_edit.html @@ -64,16 +64,6 @@ - - 工会关系: diff --git a/Application/Admin/View/Site/media.html b/Application/Admin/View/Site/media.html index 6fcd1322c..949b46d19 100644 --- a/Application/Admin/View/Site/media.html +++ b/Application/Admin/View/Site/media.html @@ -10,7 +10,7 @@