推广平台->财务管理->结算明细--检索调整

master
chenxiaojun 5 years ago
parent 102013e527
commit 4ac069e28a

@ -160,7 +160,9 @@ class FinanceController extends BaseController
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$gameId = intval(I('game_id', 0));
$payOrderNumber = I('pay_order_number', '');
$status = intval(I('status', 0));
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
@ -172,13 +174,16 @@ class FinanceController extends BaseController
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['game_id'] = $gameId;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['status'] = $status;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$data = [];
$count = 0;
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$withdrawIds = [];
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $this->loginPromote['id'];
@ -186,10 +191,29 @@ class FinanceController extends BaseController
$map = [];
$map['promote_id'] = ['in', $ids];
$map['pay_status'] = 1;
$map['pay_time'] = ['between', [$begTime, $endTime]];
if (!empty($gameId)) {
$map['game_id'] = $gameId;
}
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
if (isset($_GET['status'])) {
if ($status == -2) {
$map['selle_status'] = 0;
} else {
$withdrawMap['promote_id'] = $this->loginPromote['id'];
$withdrawMap['status'] = $status;
$withdrawIds = M('withdraw', 'tab_')->where($withdrawMap)->getField('id', true);
if (empty($withdrawIds)) {
$map = '1 = 2';
} else {
$map['withdraw_id'] = ['in', $withdrawIds];
}
}
}
$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,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
@ -199,10 +223,12 @@ class FinanceController extends BaseController
$count = $model->where($map)->count();
//提现状态
$withdrawIds = [0];
foreach ($data as $key => $value) {
if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) {
$withdrawIds[] = $value['withdraw_id'];
if (empty($withdrawIds)) {
$withdrawIds = [0];
foreach ($data as $key => $value) {
if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) {
$withdrawIds[] = $value['withdraw_id'];
}
}
}
$withdrawStatus = M('withdraw', 'tab_')

@ -85,10 +85,37 @@
</div>
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space" style="margin-left: 0;">
<label>游戏名称:</label>
<select id="game_id" name="game_id" class="reselect select_gallery" style="min-width:200px;width: 175px;">
<option value="">全部</option>
<volist name=":getPromoteSearchGame()" id="vo">
<option value="{$vo.id}" title="{$vo.game_name}"
<if condition="I('game_id') eq $vo['id']">selected</if>
>{$vo.game_name} </option>
</volist>
</select>
</div>
<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>状态:</label>
<select id="status" name="status" class="reselect select_gallery" style="min-width:200px;width: 175px;">
<option value="" title="全部">全部</option>
<option value="-2" title="未提现"
<if condition="I('status') eq -2">selected</if>
>未提现 </option>
<?php foreach (promoteWithdrawStatus() as $key => $value) :?>
<option value="{$key}" title="{$value}"
<if condition="$key eq I('get.status') and isset($_GET['status'])"> selected </if>
>{$value}</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">充值时间:</label>
<div class="select-time">

Loading…
Cancel
Save