推广后台->财务管理->结算明细--更新

master
chenxiaojun 5 years ago
parent a32565e2e1
commit 8ae754f74a

@ -15,72 +15,78 @@ class FinanceController extends BaseController
{
public function settlementDtl()
{
$model = M('spend', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$payOrderNumber = I('pay_order_number', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$loginPromote = $this->getLoginPromote();
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new PromoteApi();
$res = $model->verify_er_User(PID, $securityCode);//验证安全密码
if ($res) {
$model = M('spend', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$payOrderNumber = I('pay_order_number', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$loginPromote = $this->getLoginPromote();
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $loginPromote['id'];
$ids = implode(',', $ids);
$map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $loginPromote['id'];
$ids = implode(',', $ids);
// var_dump($ids);
// die;
$map = [];
$map['promote_id'] = ['in', $ids];
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
if (!empty($begTime) && empty($endTime)) {
$map['pay_time'] = ['egt', $begTime];
} elseif (empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['elt', $endTime + 86399];
} elseif (!empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
}
$map = [];
$map['promote_id'] = ['in', $ids];
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
if (!empty($begTime) && empty($endTime)) {
$map['pay_time'] = ['egt', $begTime];
} elseif (empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['elt', $endTime + 86399];
} elseif (!empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
}
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,convert(pay_amount*if(selle_ratio >= 0,selle_ratio,0),decimal(10,2)) as income,pay_time,selle_status')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count();
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,convert(pay_amount*if(selle_ratio >= 0,selle_ratio,0),decimal(10,2)) as income,pay_time,selle_status')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count();
foreach ($data as &$list) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
$list['selle_status'] = '';
break;
foreach ($data as &$list) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
$list['selle_status'] = '';
break;
}
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
}
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
}
$page = set_pagination($count, $row, $parameter);
$page = set_pagination($count, $row, $parameter);
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
$this->assign('meta_title', '结算明细');
$this->display();
}

@ -3,6 +3,7 @@
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/detailed.css?v=1.1" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
</block>
@ -62,95 +63,144 @@
width: 180px;
height: 34px;
}
.input-security {
width: 500px;
height: 2.5rem;
padding-left: 10px;
border-radius: 5px;
border: 0;
}
.btn-security {
width: 300px;
height: 2.4rem;
border: 0;
border-radius: 5px;
background-color: #358fe4;
color: #fff;
}
.btn-security-close {
width: 300px;
height: 2.4rem;
border: 0;
border-radius: 5px;
background-color: #fff;
color: #999;
}
</style>
<div class="page-search normal_list query-recharge-search jssearch">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>财务管理></span><span>{$meta_title}</span></div>
</div>
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">{$meta_title}</span>
<if condition="isset($listData)">
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">{$meta_title}</span>
<else/>
<span class="title_main">安全密码</span>
</if>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<div class="tab normal_tab">
</div>
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space">
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="请输入游戏订单号"
value="{:I('pay_order_number','')}">
</div>
<if condition="isset($listData)">
<div class="trunk-search clearfix">
<div class="tab normal_tab">
</div>
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space">
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="请输入游戏订单号"
value="{:I('pay_order_number','')}">
</div>
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">充值时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">充值时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Finance/settlementDtl','model='.$model['name'],false)}"
value="查询">
</div>
<!-- </form> -->
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Finance/settlementDtl','model='.$model['name'],false)}"
value="查询">
</div>
<!-- </form> -->
</div>
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>游戏订单号</th>
<th>游戏</th>
<th>玩家账号</th>
<th>推广员账号</th>
<th>订单总额</th>
<th>直充</th>
<th>内充</th>
<th>分成比例(直充|内充)</th>
<th>收益</th>
<th>充值时间</th>
<th>订单状态</th>
</tr>
<empty name="listData">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.pay_order_number}</td>
<td>{$vo.game_name}</td>
<td>{$vo.user_account}</td>
<td>{$vo.promote_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way eq -1">
<td>0</td>
<td>{$vo.pay_amount}</td>
<else/>
<td>{$vo.pay_amount}</td>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
<td>{$vo.pay_time}</td>
<td>{$vo.selle_status}</td>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>游戏订单号</th>
<th>游戏</th>
<th>玩家账号</th>
<th>推广员账号</th>
<th>订单总额</th>
<th>直充</th>
<th>内充</th>
<th>分成比例(直充|内充)</th>
<th>收益</th>
<th>充值时间</th>
<th>订单状态</th>
</tr>
</volist>
</empty>
</table>
<empty name="listData">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.pay_order_number}</td>
<td>{$vo.game_name}</td>
<td>{$vo.user_account}</td>
<td>{$vo.promote_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way eq -1">
<td>0</td>
<td>{$vo.pay_amount}</td>
<else/>
<td>{$vo.pay_amount}</td>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
<td>{$vo.pay_time}</td>
<td>{$vo.selle_status}</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
<div class="pagenation clearfix">
{$_page}
<else/>
<div class="trunk-search clearfix" style="display: table-caption;">
<div class="tab detailed-box" style="margin-top: 40px;align-items: center;">
<label class="detailed-title detailed-label" style="margin-right: 20px;">安全密码:</label>
<div class="detailed-content-box">
<input class="input-security" id="security_password" type="password" placeholder="安全密码">
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label" style="margin-right: 20px;"></label>
<div class="detailed-content-box" style="display: flex;width: 100%;">
<button class="btn-security" style="margin-right: 20px;">确定</button>
<button class="btn-security-close">取消</button>
</div>
</div>
</div>
</div>
</if>
</div>
</div>
@ -198,6 +248,31 @@
endDate: date
});
$('.btn-security').on('click', function () {
var password = $('#security_password').val();
$.ajax({
type: "post",
url: "{:U('GameDivide/verifyPassword')}",
dataType: "json",
data: {'password': password},
success: function (data) {
if (data.status == 1) {
window.location.reload();
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
$('.btn-security-close').on('click', function () {
window.location.href = "{:U('Promote/index')}";
});
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();

Loading…
Cancel
Save