推广结算--更新

master
chenxiaojun 5 years ago
commit 3a9a7177fe

@ -1342,36 +1342,26 @@ class QueryController extends ThinkController
public function withdrawDetails($id)
{
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$id = intval($id);
$map['withdraw_id'] = $id;
$model = M('Spend', 'tab_');
$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)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count('id');
//提现状态
$withdrawStatus = M('withdraw', 'tab_')
->where(array('id' => $id))
->getField('status');
$withdrawStatus = \Home\Controller\FinanceController::$withdrawStatus[$withdrawStatus];
foreach ($data as &$list) {
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2);
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
$withdrawId = intval($id);
$withdraw = D('withdraw')->find($withdrawId);
$records = [];
if (!empty($withdraw) && !empty($withdraw['game_ratio'])) {
$gameRatios = json_decode($withdraw['game_ratio'], true);
foreach ($gameRatios as $gameId => $gameRatio) {
$gameName = D('game')->where(array('id' => $gameId))->getField('game_name');
foreach ($gameRatio as $list) {
$records[] = [
'settlement_time' => "{$list['begin_time']} - {$list['end_time']}",
'game_name' => $gameName ?? '未知',
'sum_amount' => $list['sum_amount'],
'ratio' => $list['selle_ratio'] . '%',
'settlement_amount' => bcdiv(bcmul($list['sum_amount'], $list['selle_ratio'], 2), 100, 2),
];
}
}
}
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('withdrawStatus', $withdrawStatus);
$this->assign('records', $records);
$this->display();
}

@ -32,40 +32,23 @@ body{ padding: 0px; }
<!-- 表头 -->
<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>
<th>结算总额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="listData" id="vo">
<volist name="records" id="record">
<tr>
<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>{$withdrawStatus}</td>
<td>{$record.settlement_time}</td>
<td>{$record.game_name}</td>
<td>{$record.sum_amount}</td>
<td>{$record.ratio}</td>
<td>{$record.settlement_amount}</td>
</tr>
</volist>
</tbody>

Loading…
Cancel
Save