Merge branch 'feature/thrid_party_ip' of wmtx/platform into release
苹果beta包添加第三方支付名单master
commit
960ed47c3c
@ -0,0 +1,216 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
|
||||
class ThirdPartyIpController extends ThinkController
|
||||
{
|
||||
|
||||
public function index($p = 1) {
|
||||
|
||||
$page = intval($p);
|
||||
$page = $page ? $page : 1; //默认显示第一页数据
|
||||
|
||||
if (isset($_REQUEST['row'])) {
|
||||
$row = $_REQUEST['row'];
|
||||
} else {
|
||||
$row = 10;
|
||||
}
|
||||
|
||||
$map = [];
|
||||
$map['type'] = 1;
|
||||
|
||||
if ($_REQUEST['user_account']) {
|
||||
$map['user_account'] = ['like',"%{$_REQUEST['user_account']}%"];
|
||||
}
|
||||
|
||||
$data = M('forbit_ip','tab_')
|
||||
->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('添加失败');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
<extend name="Public/base" />
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script><!--
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script> -->
|
||||
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">新增第三方支付开放名单</h3>
|
||||
<p class="description_text">说明:此功能是新增苹果第三方支付开放名单</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tab-wrap">
|
||||
|
||||
<div class="tab-content tabcon1711">
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:U('addUser?model='.$model['id'])}" method="post" class="form-horizontal">
|
||||
<!-- 基础文档模型 -->
|
||||
<div id="tab1" class="tab-pane in tab1">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">玩家账号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="account" value="" placeholder="输入玩家账号" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>-->
|
||||
<!-- <td class="l">状态:</td>-->
|
||||
<!-- <td class="r table_radio">-->
|
||||
<!-- <span class="form_radio table_btn">-->
|
||||
<!-- <label >-->
|
||||
<!-- <input type="radio" value="0" name="status" checked="checked"> 通知不到账-->
|
||||
<!-- </label >-->
|
||||
<!-- <label >-->
|
||||
<!-- <input type="radio" value="1" name="status" > 通知到账-->
|
||||
<!-- </label>-->
|
||||
<!-- </span>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td class="l">区域</td>-->
|
||||
<!-- <td class="r">-->
|
||||
<!-- <select name="area" id="area">-->
|
||||
<!-- <option value="">请选择区域</option>-->
|
||||
<!-- <option value="美国">美国</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="{$data['id']}" />
|
||||
|
||||
<div class="form-item cf">
|
||||
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
|
||||
保存
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/1">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script><script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('AmericaIpForbit/index')}');
|
||||
Think.setValue("game_type_id", {$data.game_type_id|default = 0});
|
||||
Think.setValue("category", {$data.category|default = 0});
|
||||
|
||||
$(function(){
|
||||
showTab();
|
||||
prov="{:substr($data['bank_area'],0,2)}";
|
||||
city="{:substr($data['bank_area'],2,2)}";
|
||||
ciarea="{:substr($data['bank_area'],4,2)}";
|
||||
$("input[name=company_belong]").click(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#company_relation').show();
|
||||
} else {
|
||||
$('#company_relation').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
//得到地区码
|
||||
function getAreaID(){
|
||||
var area = 0;
|
||||
if($("#seachdistrict").val() != "0"){
|
||||
area = $("#seachdistrict").val();
|
||||
}else if ($("#seachcity").val() != "0"){
|
||||
area = $("#seachcity").val();
|
||||
}else{
|
||||
area = $("#seachprov").val();
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
||||
|
||||
//根据地区码查询地区名
|
||||
function getAreaNamebyID(areaID){
|
||||
var areaName = "";
|
||||
if(areaID.length == 2){
|
||||
areaName = area_array[areaID];
|
||||
}else if(areaID.length == 4){
|
||||
var index1 = areaID.substring(0, 2);
|
||||
areaName = area_array[index1] + " " + sub_array[index1][areaID];
|
||||
}else if(areaID.length == 6){
|
||||
var index1 = areaID.substring(0, 2);
|
||||
var index2 = areaID.substring(0, 4);
|
||||
areaName = area_array[index1] + " " + sub_array[index1][index2] + " " + sub_arr[index2][areaID];
|
||||
}
|
||||
return areaName;
|
||||
}
|
||||
</script>
|
||||
</block>
|
||||
|
Loading…
Reference in New Issue