推广结算--更新

master
chenxiaojun 5 years ago
commit 3a9a7177fe

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

@ -32,40 +32,23 @@ body{ padding: 0px; }
<!-- 表头 --> <!-- 表头 -->
<thead> <thead>
<tr> <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> </tr>
</thead> </thead>
<!-- 列表 --> <!-- 列表 -->
<tbody> <tbody>
<volist name="listData" id="vo"> <volist name="records" id="record">
<tr> <tr>
<td>{$vo.pay_order_number}</td> <td>{$record.settlement_time}</td>
<td>{$vo.game_name}</td> <td>{$record.game_name}</td>
<td>{$vo.user_account}</td> <td>{$record.sum_amount}</td>
<td>{$vo.promote_account}</td> <td>{$record.ratio}</td>
<td>{$vo.pay_amount}</td> <td>{$record.settlement_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>
</tr> </tr>
</volist> </volist>
</tbody> </tbody>

Loading…
Cancel
Save