@ -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();
}
}