Merge branch 'release' of 47.111.118.107:wmtx/platform into release

master
ELF 5 years ago
commit 7833847e72

@ -2033,8 +2033,9 @@ function getWithdrawNumber() {
$data = M('withdraw',"tab_")
->field("widthdraw_number")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->where("ext_field is null")
->where("ext_field is null and tab_promote_belong.company_type!=2")
->select();
return $data;
@ -2105,4 +2106,11 @@ function getGameCpRadio($game_id,$amount,$type) {
}
function check_str($str, $substr)
{
$nums=substr_count($str,$substr);
return $nums;
}
?>

@ -34,7 +34,7 @@ class PromoteGameRatioController extends ThinkController
$map['_string'] = 'game_id = relation_game_id';
$where['_string'] = '1 = 1';
if ($companyId || ($companyBelong !== '' && in_array($companyBelong, [0, 1]))) {
$promoteMap['_string'] = '1 = 1';
$promoteMap['level'] = 1;
if ($companyId) {
$promoteMap['company_id'] = $companyId;
}
@ -146,7 +146,7 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteStatus = $thisPromoteStatus ?? '待审核';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2);
$thisCompanyName = getPromoteCompanyName($promotes[$thisPromoteId]['company_id']);
$thisCompanyBelong = $promotes[$thisPromoteId]['company_belong'] == 1 ? '外团' : '内团';
$thisCompanyBelong = $promotes[$thisPromoteId]['company_belong'] ? '外团' : '内团';
}
if ($issetGame) {
$thisGameName = $games[$thisGameId]['relation_game_name'];

@ -1563,7 +1563,7 @@ class QueryController extends ThinkController
$data = M()->table('('.$data.') as a')
->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio,a.ratio as game_ratio")
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id and tab_ratio.status=1")
// ->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id")
->page($page,$row)
->where($map)
@ -1643,13 +1643,13 @@ class QueryController extends ThinkController
if (is_array($value['turnover_ratio'])) {
foreach($value['turnover_ratio'] as $k =>$v) {
if($value['pay_amount']>$v['turnover']) {
if(($value['pay_amount']>=$v['turnover']&&$v['instanceof']==1) || $value['pay_amount']>$v['turnover']) {
$data[$key]['downstream'] = $value['pay_amount'] * ($v['ratio']*0.01);
}
}
}
$data[$key]['highquality'] = number_format(($value['pay_amount']-$data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672),2,'.','');
$data[$key]['highquality'] = number_format(($value['pay_amount'] - $initNum - $data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672),2,'.','');
$data[$key]['company_belong'] = $data[$key]['company_belong']?'外团':'内团';
$data[$key]['company_relation'] = $data[$key]['company_relation']?'只维护':'自主开发及维护';

@ -351,101 +351,445 @@ class StatementMangementController extends ThinkController
public function PersonOrderList() {
$map = [];
if ($_REQUEST['time_start'] || $_REQUEST['time_end'] ) {
$withdrawMap = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$withdrawMap['settlement_begin_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
$data = M('withdraw','tab_')
->field("tab_withdraw.id,pc.company_name,pc.id as cid,tab_withdraw.promote_id,tab_withdraw.promote_account,username,'个人' as type,game_ratio
,mobile_phone,real_name,tab_promote.bank_card,account_openin,tab_promote.address,bank_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->join("left join tab_promote on tab_promote.id=tab_promote_belong.promote_id")
->join("left join tab_promote_company as pc on pc.id = tab_promote.company_id")
->join("left join sys_ucenter_member on sys_ucenter_member.id=tab_promote.admin_id")
->where("ext_field is null and tab_promote_belong.company_type=2")
->where($map)
->select();
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$withdrawMap['settlement_end_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$withdrawMap['settlement_begin_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$withdrawMap['settlement_end_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
$data = M('withdraw',"tab_")
->field("widthdraw_number,settlement_begin_time,settlement_end_time,settlement_type,promote_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->where("ext_field is null and tab_promote_belong.company_type=2")
->where($withdrawMap)
->select();
$statement = M('statement','tab_')
->field('ext_field')
->where(['ext_field'=>['like','%,%']])
->select();
$gameStr = [];
$game_ratio = [];
foreach($data as $dkey => &$dval) {
$withdrawData = [];
$dval['game_ratio'] = json_decode($dval['game_ratio'],true);
foreach($statement as $key => $value) {
if (is_array($dval['game_ratio'])) {
foreach ($dval['game_ratio'] as $key => &$value) {
$handleData = explode(',',$value['ext_field']);
foreach ($handleData as $hk => $hv) {
array_push($withdrawData,$hv);
}
}
foreach ($data as $key => $value) {
$data[$key]['settlement_begin_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_begin_time']);
$data[$key]['settlement_end_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_end_time']);
if (in_array($value['widthdraw_number'],$withdrawData)) {
unset($data[$key]);
}
}
foreach ($value as $k => &$v) {
$this->assign('withdraw_data',$data);
}
if ($_REQUEST['withdraw']&&$data) {
$map = [];
$map['widthdraw_number'] = ['in',$_REQUEST['withdraw']];
$data = M('withdraw','tab_')
->field("tab_withdraw.id,pc.company_name,pc.id as cid,tab_withdraw.promote_id,tab_withdraw.promote_account,username,'个人' as type,game_ratio
,mobile_phone,real_name,tab_promote.bank_card,account_openin,tab_promote.address,bank_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->join("left join tab_promote on tab_promote.id=tab_promote_belong.promote_id")
->join("left join tab_promote_company as pc on pc.id = tab_promote.company_id")
->join("left join sys_ucenter_member on sys_ucenter_member.id=tab_promote.admin_id")
->where("ext_field is null and tab_promote_belong.company_type=2")
->where($map)
->select();
$game_ratio = [];
foreach($data as $dkey => &$dval) {
$gameStr = [];
// $address = '';
// if (is_array($data['address'])) {
// foreach($data['address'] as $key => $value) {
// $address = $address.' '.$value;
// }
// }
// $dval['address'] = $address;
$rowspan = 0;
$dval['rowspan'] = 0;
$dval['game_ratio'] = json_decode($dval['game_ratio'],true);
if (is_array($dval['game_ratio'])) {
foreach ($dval['game_ratio'] as $key => &$value) {
foreach ($value as $k => &$v) {
// $v['game_id'] = $key;
$v['game_name'] = substr(get_gamename($key),0,strpos(get_gamename($key), '('));
$v['game_name'] = substr(get_gamename($key),0,strpos(get_gamename($key), '('));
if (!in_array($v['game_name'],$gameStr)) {
array_push($gameStr,$v['game_name']);
if (!in_array($v['game_name'],$gameStr)) {
array_push($gameStr,$v['game_name']);
} else {
} else {
// var_dump($key);
if (!$game_ratio[$v['game_name']]) {
$game_ratio[$v['game_name']] = $v;
if (!$game_ratio[$v['game_name']]) {
$game_ratio[$v['game_name']] = $v;
}
else {
$game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount'];
}
unset($value[$k]);
}
else {
$game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount'];
}
unset($value[$k]);
}
//
}
if (!$value) {
unset($dval['game_ratio'][$key]);
}
}
if (!$value) {
foreach ($dval['game_ratio'] as $key => $val) {
$val[0]['reward'] = 0;
$val[0]['forfeit'] = 0;
$startTime = strtotime($val[0]['begin_time']);
$endTime = strtotime($val[0]['end_time']);
$rewardData = M('reward_record','tab_')
->field("sum(tab_reward_record.money) as money,reward_type,relation_game_name")
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$val[0]['game_name']}%"],'reward_time'=>['between',[$startTime,$endTime]]])
->group('reward_type')
->select();
foreach ($rewardData as $rk => $rv) {
if ($rv['reward_type'] == 1) {
$val[0]['reward'] = $rv['money'];
} else {
$val[0]['forfeit'] = $rv['money'];
}
}
foreach ($val as $k => &$v) {
if ($game_ratio[$v['game_name']]) {
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
}
//计算结算金额
$val[0]['real_amount'] = number_format($val[0]['sum_amount'] * ($val[0]['selle_ratio']/100)+$val[0]['reward']-$val[0]['forfeit'],2,'.','');
}
$rowspan++;
unset($dval['game_ratio'][$key]);
array_push($dval['game_ratio'],$val[0]);
}
$dval['rowspan'] = $rowspan;
}
}
$this->assign('data',$data);
}
$this->display();
}
public function savePersonOrder() {
// dump($_POST);
$data['statement_info'] = $_POST['statement_info'];
$data['first_party_info'] = json_encode([]);
$data['second_party_info'] = $_POST['second_party_info'];
$data['statement_begin_time'] = strtotime($_POST['time_start']);
$data['statement_end_time'] = strtotime($_POST['time_end']);
$data['create_time'] = time();
$data['statement_money'] = 0;
$data['pay_amount'] = 0;
$data['ext_field'] = '';
$data['company_name'] = '个人结账单';
$data['statement_type'] = 2;
if($data['second_party_info'] == '[]' || $data['statement_info'] == '[]') {
$this->ajaxReturn(['status'=>1,'msg'=>'数据错误']);
}
$statement_info = json_decode($data['statement_info'],true);
foreach($statement_info as $key => $value) {
$data['statement_money'] += $value['sum_amount'];
$data['pay_amount'] += $value['real_amount'];
}
$second_party_info = json_decode($data['second_party_info'],true);
foreach($second_party_info as $key => $value) {
$data['ext_field'] = $data['ext_field'].$value['widthdraw_number'].',';
}
$is_exist = M('statement','tab_')->where(['ext_field'=>$data['ext_field'],'statement_type'=>2])->find();
if ($is_exist) {
$this->ajaxReturn(['status'=>0,'msg'=>'请勿重复添加']);
}
$is_save = M('statement','tab_')->add($data);
if ($is_save) {
$this->ajaxReturn(['status'=>1,'msg'=>'生成成功']);
} else {
$this->ajaxReturn(['status'=>0,'msg'=>'生成失败']);
}
}
foreach ($dval['game_ratio'] as $key => $val) {
public function PersonOrderEdit() {
$startTime = strtotime($val[0]['begin_time']);
$endTime = strtotime($val[0]['end_time']);
if ($_REQUEST['time_start'] || $_REQUEST['time_end'] ) {
$withdrawMap = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$withdrawMap['settlement_begin_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
$rewardData = M('reward_record','tab_')
->field("sum(tab_reward_record.money) as money,reward_type,relation_game_name")
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$val[0]['game_name']}%"],'reward_time'=>['between',[$startTime,$endTime]]])
->group('reward_type')
->select();
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$withdrawMap['settlement_end_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
foreach ($rewardData as $rk => $rv) {
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$withdrawMap['settlement_begin_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$withdrawMap['settlement_end_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($rv['reward_type'] == 1) {
$val[0]['reward'] = $rv['money'];
} else {
$val[0]['forfeit'] = $rv['money'];
$data = M('withdraw',"tab_")
->field("widthdraw_number,settlement_begin_time,settlement_end_time,settlement_type,promote_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->where("tab_promote_belong.company_type=2")
->where($withdrawMap)
->select();
// dump($data);die();
// $statement = M('statement','tab_')
// ->field('ext_field')
// ->where(['ext_field'=>['like','%,%']])
// ->select();
//
// $withdrawData = [];
//
// foreach($statement as $key => $value) {
//
// $handleData = explode(',',$value['ext_field']);
//
// foreach ($handleData as $hk => $hv) {
// array_push($withdrawData,$hv);
// }
//
// }
//
// foreach ($data as $key => $value) {
// $data[$key]['settlement_begin_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_begin_time']);
// $data[$key]['settlement_end_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_end_time']);
//
// if (in_array($value['widthdraw_number'],$withdrawData)) {
// unset($data[$key]);
// }
//
// }
//
// foreach ($data as $key => $value) {
// $data[$key]['settlement_begin_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_begin_time']);
// $data[$key]['settlement_end_time'] = date("Y-m-d H:i:s", $data[$key]['settlement_end_time']);
//
// }
$this->assign('withdraw_data',$data);
}
if ($_REQUEST['withdraw']&&$data) {
$map = [];
$map['widthdraw_number'] = ['in',$_REQUEST['withdraw']];
$data = M('withdraw','tab_')
->field("tab_withdraw.id,pc.company_name,pc.id as cid,tab_withdraw.promote_id,tab_withdraw.promote_account,username,'个人' as type,game_ratio
,mobile_phone,real_name,tab_promote.bank_card,account_openin,tab_promote.address,bank_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->join("left join tab_promote on tab_promote.id=tab_promote_belong.promote_id")
->join("left join tab_promote_company as pc on pc.id = tab_promote.company_id")
->join("left join sys_ucenter_member on sys_ucenter_member.id=tab_promote.admin_id")
->where("tab_promote_belong.company_type=2")
->where($map)
->select();
$game_ratio = [];
foreach($data as $dkey => &$dval) {
$gameStr = [];
$rowspan = 0;
$dval['rowspan'] = 0;
$dval['game_ratio'] = json_decode($dval['game_ratio'],true);
if (is_array($dval['game_ratio'])) {
foreach ($dval['game_ratio'] as $key => &$value) {
foreach ($value as $k => &$v) {
// $v['game_id'] = $key;
$v['game_name'] = substr(get_gamename($key),0,strpos(get_gamename($key), '('));
if (!in_array($v['game_name'],$gameStr)) {
array_push($gameStr,$v['game_name']);
} else {
// var_dump($key);
if (!$game_ratio[$v['game_name']]) {
$game_ratio[$v['game_name']] = $v;
}
else {
$game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount'];
}
unset($value[$k]);
}
//
}
if (!$value) {
unset($dval['game_ratio'][$key]);
}
}
foreach ($dval['game_ratio'] as $key => $val) {
$val[0]['reward'] = 0;
$val[0]['forfeit'] = 0;
$startTime = strtotime($val[0]['begin_time']);
$endTime = strtotime($val[0]['end_time']);
$rewardData = M('reward_record','tab_')
->field("sum(tab_reward_record.money) as money,reward_type,relation_game_name")
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$val[0]['game_name']}%"],'reward_time'=>['between',[$startTime,$endTime]]])
->group('reward_type')
->select();
foreach ($rewardData as $rk => $rv) {
foreach ($val as $k => &$v) {
if ($rv['reward_type'] == 1) {
$val[0]['reward'] = $rv['money'];
} else {
$val[0]['forfeit'] = $rv['money'];
}
}
if ($game_ratio[$v['game_name']]) {
foreach ($val as $k => &$v) {
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
if ($game_ratio[$v['game_name']]) {
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
}
//计算结算金额
$val[0]['real_amount'] = number_format($val[0]['sum_amount'] * ($val[0]['selle_ratio']/100)+$val[0]['reward']-$val[0]['forfeit'],2,'.','');
}
$rowspan++;
unset($dval['game_ratio'][$key]);
array_push($dval['game_ratio'],$val[0]);
}
unset($dval['game_ratio'][$key]);
array_push($dval['game_ratio'],$val[0]);
}
$dval['rowspan'] = $rowspan;
}
}
$this->assign('data',$data);
}
$this->display();
}
dump($data);
public function savePersonOrderEdit() {
$this->display();
$data['statement_info'] = $_POST['statement_info'];
$data['first_party_info'] = json_encode([]);
$data['second_party_info'] = $_POST['second_party_info'];
$data['statement_begin_time'] = strtotime($_POST['time_start']);
$data['statement_end_time'] = strtotime($_POST['time_end']);
$data['create_time'] = time();
$data['statement_money'] = 0;
$data['pay_amount'] = 0;
$data['ext_field'] = '';
$data['company_name'] = '个人结账单';
$data['statement_type'] = 2;
if($data['second_party_info'] == '[]' || $data['statement_info'] == '[]') {
$this->ajaxReturn(['status'=>1,'msg'=>'数据错误']);
}
$statement_info = json_decode($data['statement_info'],true);
foreach($statement_info as $key => $value) {
$data['statement_money'] += $value['sum_amount'];
$data['pay_amount'] += $value['real_amount'];
}
$second_party_info = json_decode($data['second_party_info'],true);
foreach($second_party_info as $key => $value) {
$data['ext_field'] = $data['ext_field'].$value['widthdraw_number'].',';
}
$data['ext_field'] = rtrim($data['ext_field'], ",");
$is_save = M('statement','tab_')->where(['id'=>$_REQUEST['withdraw_id']])->save($data);
if ($is_save) {
$this->ajaxReturn(['status'=>1,'msg'=>'修改成功']);
} else {
$this->ajaxReturn(['status'=>0,'msg'=>'修改失败']);
}
}
}

@ -0,0 +1,465 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
</head>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
body {
padding: 50px 50px 50px 50px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</style>
<body>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<input type="text" id="withdraw_id" style="display: none" value="{:I('id')}"/>
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id='search' url="{:U('StatementMangement/PersonOrderEdit','model='.$model['name'] .'&row='.I('row'),false)}">生成</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>提现订单号</th>
<th>结算时间</th>
<th>订单类型</th>
<th>会长</th>
</tr>
</thead>
<!-- 列表 -->
<tbody class="setData">
<if condition = "empty($withdraw_data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "withdraw_data">
<volist name="withdraw_data" id="withdraw_data">
<tr>
<td ><input class="ids" type="checkbox" value="{$withdraw_data.widthdraw_number}" name="ids[]" onclick="shenhe()"
<if condition = "check_str($_REQUEST['withdraw'],$withdraw_data['widthdraw_number']) gt 0">checked="checked" </if> >
</td>
<td >{$withdraw_data.widthdraw_number}</td>
<td >{$withdraw_data.settlement_begin_time} - {$withdraw_data.settlement_end_time}</td>
<td ><if condition = "$withdraw_data.settlement_type eq 1">周结<elseif condition = "$withdraw_data.settlement_type eq 2"/>月结<elseif condition = "$withdraw_data.settlement_type eq 3"/>补点</if></td>
<td >{$withdraw_data.promote_account}</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<!-- <div class="cf top_nav_list" style="margin-top: 20px">-->
<!-- &lt;!&ndash; 高级搜索 &ndash;&gt;-->
<!-- <div class="jssearch fl cf search_list">-->
<!-- <div class="input-list">-->
<!-- <a class="sch-btn" href="javascript:;" style="border: #0a0a0a solid 1px;width: 120px" onclick="shenhe()">预览</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<if condition = "empty($data)">
<else/>
<div class="data_list" style="margin-top: 30px">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>序号</th>
<th>下游名称</th>
<th>会长账号</th>
<th>市场员</th>
<th>下游类型</th>
<th>产品</th>
<th>结算时间</th>
<th>推广流水</th>
<th>分成比例</th>
<th>奖励</th>
<th>罚款</th>
<th>结算金额</th>
<th>开户名</th>
<th>银行卡号</th>
<th>开户支行</th>
</tr>
</thead>
<!-- 列表 -->
<tbody class="withdraw_datas">
<notemtpy name = "data">
<volist name="data" id="data">
<if condition = "$data.game_ratio eq ''">
<tr>
<td >{$data.id}</td>
<td >{$data.company_name}</td>
<td >{$data.promote_account}</td>
<td >{$data.username}</td>
<td >{$data.type}</td>
<td></td>
<td>-</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td >{$data.bank_account}</td>
<td >{$data.bank_card}</td>
<td >{$data.account_openin}</td>
</tr>
</if>
<volist name="data.game_ratio" id="game_ratio">
<tr>
<td >{$data.id}</td>
<td >{$data.company_name}</td>
<td >{$data.promote_account}</td>
<td >{$data.username}</td>
<td >{$data.type}</td>
<td>{$game_ratio.game_name}</td>
<td>{$game_ratio.begin_time|0}&nbsp;-&nbsp;{$game_ratio.end_time|0}</td>
<td>{$game_ratio.sum_amount|0}</td>
<td>{$game_ratio.selle_ratio|0}</td>
<td>{$game_ratio.reward|0}</td>
<td>{$game_ratio.forfeit|0}</td>
<td>{$game_ratio.real_amount|0}</td>
<td >{$data.bank_account}</td>
<td >{$data.bank_card}</td>
<td >{$data.account_openin}</td>
</tr>
</volist>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="cf top_nav_list" style="margin-top: 50px">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="confirm" url="{:U('Query/marketList','model='.$model['name'] .'&row='.I('row'),false)}" style="border: #0a0a0a solid 1px;width: 120px">确认生成</a>
</div>
</div>
<div class="jssearch fl cf search_list">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="back" style="width: 120px;background:#fff;color: #0a0a0a;border: #0a0a0a solid 1px">取消</a>
</div>
</div>
</div>
</if>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
</if>
{$_page|default=''}
</div>
</body>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function reload() {
window.location.reload();
}
function shenhe(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get().join(",");
var id =$("#withdraw_id").val();
var url = "/admin.php?s=/statementMangement/PersonOrderEdit/withdraw/" + text + "/time_start/" + $("#time_start").val() + "/time_end/" + $("#time_end").val() + "/id/" + id;
console.log(url)
window.location.replace(url);
}
$(function(){
//搜索功能
var start = $("#time_start").val();
var end = $("#time_end").val();
var withdraw_id =$("#withdraw_id").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
$("#confirm").click(function() {
var withdraw_datas = [];
$('.withdraw_datas tr').each(function() {
var row = {};
$(this).find('td').each(function(index) {
if (index == 0) {
row['id'] = $(this).text();
} else if (index == 1) {
row['company_name'] = $(this).text();
}else if (index == 2) {
row['promote_account'] = $(this).text();
}else if (index == 3) {
row['username'] = $(this).text();
}else if (index == 4) {
row['type'] = $(this).text();
}else if (index == 5) {
row['game_name'] = $(this).text();
}else if (index == 6) {
row['time'] = $(this).text();
}else if (index == 7) {
row['sum_amount'] = $(this).text();
}else if (index == 8) {
row['selle_ratio'] = $(this).text();
}else if (index == 9) {
row['reward'] = $(this).text();
}else if (index == 10) {
row['forfeit'] = $(this).text();
}else if (index == 11) {
row['real_amount'] = $(this).text();
}else if (index == 12) {
row['bank_account'] = $(this).text();
}else if (index == 13) {
row['bank_card'] = $(this).text();
}else if (index == 14) {
row['account_openin'] = $(this).text();
}
});
withdraw_datas.push(row);
});
var setData = [];
$('.setData tr').each(function() {
var row = {};
var checked = $(this).find('input').is(":checked");
if (checked) {
$(this).find('td').each(function(index) {
// console.log($(this).text());return;
if (index == 1) {
row['widthdraw_number'] = $(this).text();
} else if (index == 2) {
row['time'] = $(this).text();
}else if (index == 3) {
row['settlement_type'] = $(this).text();
}else if (index == 4) {
row['promote_account'] = $(this).text();
}
});
setData.push(row);
}
});
$.ajax({
url: "{:U('StatementMangement/savePersonOrderEdit')}",
type: "post",
data: {"second_party_info": JSON.stringify(setData),"statement_info":JSON.stringify(withdraw_datas),"time_start":start,"time_end":end,"withdraw_id":withdraw_id},
dataType: 'json',
success: function (data) {
layer.msg(data.msg);
setTimeout(function(){
window.parent.reload();
},1500);
}
});
console.log(JSON.stringify(withdraw_datas));
console.log(setData);
}
);
//设置对账网址
var order_url = window.location.protocol+"//"+window.location.host+"/admin.php?s=/Public/cp_login.html";
$("#order_url").html("结算单管理,对账地址:<spen style='margin-left:10px;'>"+order_url+"</spen>");
//全选的实现
$(".check-all").click(function(){
$('.ids').prop("checked", this.checked);
shenhe();
});
$(".ids").click(function(){
var option = $(".ids");
option.each(function(i){
if(!this.checked){
$(".check-all").prop("checked", false);
return false;
}else{
$(".check-all").prop("checked", true);
}
});
});
$("#search").click(function(){
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url + '&id=' + withdraw_id;
});
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>

@ -0,0 +1,464 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
</head>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
body {
padding: 50px 50px 50px 50px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</style>
<body>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id='search' url="{:U('StatementMangement/PersonOrderList','model='.$model['name'] .'&row='.I('row'),false)}">生成</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>提现订单号</th>
<th>结算时间</th>
<th>订单类型</th>
<th>会长</th>
</tr>
</thead>
<!-- 列表 -->
<tbody class="setData">
<if condition = "empty($withdraw_data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "withdraw_data">
<volist name="withdraw_data" id="withdraw_data">
<tr>
<td ><input class="ids" type="checkbox" value="{$withdraw_data.widthdraw_number}" name="ids[]" onclick="shenhe()"
<if condition = "check_str($_REQUEST['withdraw'],$withdraw_data['widthdraw_number']) gt 0">checked="checked" </if> >
</td>
<td >{$withdraw_data.widthdraw_number}</td>
<td >{$withdraw_data.settlement_begin_time} - {$withdraw_data.settlement_end_time}</td>
<td ><if condition = "$withdraw_data.settlement_type eq 1">周结<elseif condition = "$withdraw_data.settlement_type eq 2"/>月结<elseif condition = "$withdraw_data.settlement_type eq 3"/>补点</if></td>
<td >{$withdraw_data.promote_account}</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<!-- <div class="cf top_nav_list" style="margin-top: 20px">-->
<!-- &lt;!&ndash; 高级搜索 &ndash;&gt;-->
<!-- <div class="jssearch fl cf search_list">-->
<!-- <div class="input-list">-->
<!-- <a class="sch-btn" href="javascript:;" style="border: #0a0a0a solid 1px;width: 120px" onclick="shenhe()">预览</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<if condition = "empty($data)">
<else/>
<div class="data_list" style="margin-top: 30px">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>序号</th>
<th>下游名称</th>
<th>会长账号</th>
<th>市场员</th>
<th>下游类型</th>
<th>产品</th>
<th>结算时间</th>
<th>推广流水</th>
<th>分成比例</th>
<th>奖励</th>
<th>罚款</th>
<th>结算金额</th>
<th>开户名</th>
<th>银行卡号</th>
<th>开户支行</th>
</tr>
</thead>
<!-- 列表 -->
<tbody class="withdraw_datas">
<notemtpy name = "data">
<volist name="data" id="data">
<if condition = "$data.game_ratio eq ''">
<tr>
<td >{$data.id}</td>
<td >{$data.company_name}</td>
<td >{$data.promote_account}</td>
<td >{$data.username}</td>
<td >{$data.type}</td>
<td></td>
<td>-</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td >{$data.bank_account}</td>
<td >{$data.bank_card}</td>
<td >{$data.account_openin}</td>
</tr>
</if>
<volist name="data.game_ratio" id="game_ratio">
<tr>
<td >{$data.id}</td>
<td >{$data.company_name}</td>
<td >{$data.promote_account}</td>
<td >{$data.username}</td>
<td >{$data.type}</td>
<td>{$game_ratio.game_name}</td>
<td>{$game_ratio.begin_time|0}&nbsp;-&nbsp;{$game_ratio.end_time|0}</td>
<td>{$game_ratio.sum_amount|0}</td>
<td>{$game_ratio.selle_ratio|0}</td>
<td>{$game_ratio.reward|0}</td>
<td>{$game_ratio.forfeit|0}</td>
<td>{$game_ratio.real_amount|0}</td>
<td >{$data.bank_account}</td>
<td >{$data.bank_card}</td>
<td >{$data.account_openin}</td>
</tr>
</volist>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="cf top_nav_list" style="margin-top: 50px">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="confirm" url="{:U('Query/marketList','model='.$model['name'] .'&row='.I('row'),false)}" style="border: #0a0a0a solid 1px;width: 120px">确认生成</a>
</div>
</div>
<div class="jssearch fl cf search_list">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="back" style="width: 120px;background:#fff;color: #0a0a0a;border: #0a0a0a solid 1px">取消</a>
</div>
</div>
</div>
</if>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
</if>
{$_page|default=''}
</div>
</body>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function reload() {
window.location.reload();
}
function shenhe(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get().join(",");
var url = "/admin.php?s=/statementMangement/PersonOrderList/withdraw/" + text + "/time_start/" + $("#time_start").val() + "/time_end/" + $("#time_end").val();
console.log(url)
window.location.replace(url);
}
$(function(){
//搜索功能
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
$("#confirm").click(function() {
var withdraw_datas = [];
$('.withdraw_datas tr').each(function() {
var row = {};
$(this).find('td').each(function(index) {
if (index == 0) {
row['id'] = $(this).text();
} else if (index == 1) {
row['company_name'] = $(this).text();
}else if (index == 2) {
row['promote_account'] = $(this).text();
}else if (index == 3) {
row['username'] = $(this).text();
}else if (index == 4) {
row['type'] = $(this).text();
}else if (index == 5) {
row['game_name'] = $(this).text();
}else if (index == 6) {
row['time'] = $(this).text();
}else if (index == 7) {
row['sum_amount'] = $(this).text();
}else if (index == 8) {
row['selle_ratio'] = $(this).text();
}else if (index == 9) {
row['reward'] = $(this).text();
}else if (index == 10) {
row['forfeit'] = $(this).text();
}else if (index == 11) {
row['real_amount'] = $(this).text();
}else if (index == 12) {
row['bank_account'] = $(this).text();
}else if (index == 13) {
row['bank_card'] = $(this).text();
}else if (index == 14) {
row['account_openin'] = $(this).text();
}
});
withdraw_datas.push(row);
});
var setData = [];
$('.setData tr').each(function() {
var row = {};
var checked = $(this).find('input').is(":checked");
if (checked) {
$(this).find('td').each(function(index) {
// console.log($(this).text());return;
if (index == 1) {
row['widthdraw_number'] = $(this).text();
} else if (index == 2) {
row['time'] = $(this).text();
}else if (index == 3) {
row['settlement_type'] = $(this).text();
}else if (index == 4) {
row['promote_account'] = $(this).text();
}
});
setData.push(row);
}
});
$.ajax({
url: "{:U('StatementMangement/savePersonOrder')}",
type: "post",
data: {"second_party_info": JSON.stringify(setData),"statement_info":JSON.stringify(withdraw_datas),"time_start":start,"time_end":end},
dataType: 'json',
success: function (data) {
layer.msg(data.msg);
setTimeout(function(){
window.parent.reload();
},1500);
}
});
console.log(JSON.stringify(withdraw_datas));
console.log(setData);
}
);
//设置对账网址
var order_url = window.location.protocol+"//"+window.location.host+"/admin.php?s=/Public/cp_login.html";
$("#order_url").html("结算单管理,对账地址:<spen style='margin-left:10px;'>"+order_url+"</spen>");
//全选的实现
$(".check-all").click(function(){
$('.ids').prop("checked", this.checked);
shenhe();
});
$(".ids").click(function(){
var option = $(".ids");
option.each(function(i){
if(!this.checked){
$(".check-all").prop("checked", false);
return false;
}else{
$(".check-all").prop("checked", true);
}
});
});
$("#search").click(function(){
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>

@ -94,6 +94,7 @@
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" id="upstream">生成上游对账单</a>
<a class="butn" id="downstream">生成下游对账单</a>
<a class="butn" id="persondownstream" style="width: 150px">生成下游个人结算单</a>
</div>
</div>
@ -124,7 +125,7 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td><if condition="$data['statement_type'] eq 0">上游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 0"/>下游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 1"/>下游补点对账单</if></td>
<td><if condition="$data['statement_type'] eq 0">上游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 0"/>下游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 1"/>下游补点对账单<elseif condition="$data['statement_type'] eq 2"/>下游个人结算单</if></td>
<td>{$data.create_time}</td>
<td>{$data.company_name}</td>
<td>{$data.statement_begin_time}-{$data.statement_end_time}</td>
@ -133,13 +134,13 @@
<td>
<a class="confirm statement_view" data-id="{$data.id}">查看</a>
<if condition="$data['is_confirm'] eq 0">
<a class="confirm statement_edit" data-id="{$data.id}" data-type="{$data.statement_type}" ext_field="{$data.ext_field}">编辑</a>
<a class="confirm statement_edit" data-id="{$data.id}" data-start="{$data.statement_begin_time}" data-end="{$data.statement_end_time}" data-type="{$data.statement_type}" ext_field="{$data.ext_field}">编辑</a>
</if>
<a class="confirm statement_del" data-type="{$data.statement_type}" data-id="{$data.id}">撤销</a>
</td>
</tr>
</volist>
<tr><td>合计</td><td colspan="10">公司对账金额合计:{$sum[1]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp对账金额合计{$sum[0]}</td></tr>
<tr><td>合计</td><td colspan="10">公司对账金额合计:{$sum[1]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp对账金额合计{$sum[0]+$sum[2]}</td></tr>
</notemtpy>
</tbody>
</table>
@ -224,14 +225,27 @@
});
});
$("#persondownstream").click(function () {
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: '/admin.php?s=/statementMangement/PersonOrderList/'
});
});
$(".statement_edit").click(function () {
var edit = $(this).data();
var ext_field = $(this).attr('ext_field');
if(edit.type == 0){
var url = "/admin.php?s=/Statement/editCpStatement/id/"+edit.id;
}else{
}else if(edit.type == 1){
var url = "/admin.php?s=/StatementMangement/editDownstreamOrder/id/"+edit.id+"/ext_field/"+ext_field;
}else if(edit.type == 2){
var url = "/admin.php?s=/StatementMangement/PersonOrderEdit/id/"+edit.id+"/withdraw/"+ext_field+"/time_start/"+edit.start+"/time_end/"+edit.end;
}
layer.open({

@ -2058,42 +2058,66 @@ class DownloadController extends BaseController {
public function promotequotaDtlExcelInfo($id,$map) {
$xlsName = "推广员详情";
$xlsCell = array(
array('user_account','玩家账号'),
array('promote_account','推广账号'),
array('game_name','游戏名称'),
array('sdk_version','平台'),
array('server_name','游戏区服'),
array('role_name','角色名'),
array('role_level','等级'),
array('create_time','创建时间'),
);
'玩家账号',
'推广账号',
'游戏名称',
'平台',
'游戏区服',
'角色名',
'等级',
'创建时间',
);
$records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$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('gb2312', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = '100000';//从数据库获取总量,假设是十万
$accessNum = count($records)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
$data = M('user_play_info','tab_')->where($map)->order('create_time desc')
->limit(($i-1)*$perSize ,$perSize)->select();
foreach($data as $dataKey => $dataValue) {
$orderLen = strlen($dataValue['user_account']);
$strLen = 3;
$hideChar = '';
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
if($value1['sdk_version'] == 1) {
$value1['sdk_version'] = "安卓版";
}
if($value1['sdk_version'] == 2) {
$value1['sdk_version'] = "苹果版";
}
$xlsData[] = $value1;
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$csvData['user_account'] = substr($dataValue['user_account'], 0, $strLen) . $hideChar . substr($dataValue['user_account'], $orderLen - $strLen);
$csvData['promote_account'] = $dataValue['promote_account'];
$csvData['game_name'] = $dataValue['game_name'];
if($dataValue['sdk_version'] == 1) {
$csvData['sdk_version'] = "安卓版";
}
if($dataValue['sdk_version'] == 2) {
$csvData['sdk_version'] = "苹果版";
}
$csvData['server_name'] = $dataValue['server_name'];
$csvData['role_name'] = $dataValue['role_name'];
$csvData['role_level'] = $dataValue['role_level'];
$csvData['create_time'] = date("Y-m-d H:i:s",$dataValue['create_time']);
mb_convert_variables('GBK', 'UTF-8', $csvData);
fputcsv($fp, $csvData);
}
unset($csvData);
ob_flush();
flush();
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
fclose($fp);
$this->backSuccessExport($id);
}
public function promotequotaExcelInfo($tid,$map) {

@ -1240,3 +1240,8 @@ CREATE TABLE `tab_test_order` (
`add_time` int(11) DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-12 zyx 推广提现--新增审核模式
ALTER TABLE `tab_statement`
MODIFY COLUMN `ext_field` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '扩展字段,如果是下游为提现单号' AFTER `pay_type`;

Loading…
Cancel
Save