|
|
|
@ -541,5 +541,110 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
->find();
|
|
|
|
|
return $data;
|
|
|
|
|
}
|
|
|
|
|
//游戏弹框详情
|
|
|
|
|
public function gameCoinDetail($p = 1) {
|
|
|
|
|
|
|
|
|
|
set_time_limit(0);
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['pay_way'])) {
|
|
|
|
|
$map['pay_way'] = $_REQUEST['pay_way'];
|
|
|
|
|
$this->assign('pay_way', $map['pay_way']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($_REQUEST['pay_order_number'])) {
|
|
|
|
|
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I('partner_id'))&&empty(I("game_id"))) {
|
|
|
|
|
$wherePartner = I('partner_id');
|
|
|
|
|
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
|
|
|
|
|
$gameId = implode(',',array_column($gameId,'id'));
|
|
|
|
|
$map['tab_spend.game_id'] = ['in',$gameId];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I('timestart'))) {
|
|
|
|
|
$timestart = strtotime(I('timestart'));
|
|
|
|
|
$map['_string'] = "pay_time > {$timestart}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I('timeend'))) {
|
|
|
|
|
$timeend = strtotime(I('timeend'));
|
|
|
|
|
$map['_string'] .= " and pay_time < {$timeend}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I("promote_id"))) {
|
|
|
|
|
$promote_id[] = I("promote_id");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I("root_id"))) {
|
|
|
|
|
$root_id = I("root_id");
|
|
|
|
|
$promote_id = $this->getPromoteList($root_id);
|
|
|
|
|
array_push($promote_id, $root_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($_REQUEST['root_id']=='0') {
|
|
|
|
|
$map['tab_spend.promote_id'] = $_REQUEST['root_id'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promote_id = implode(',',$promote_id);
|
|
|
|
|
if ($promote_id) {
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in',$promote_id];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$page = intval($p);
|
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
|
|
if (isset($_REQUEST['row'])) {
|
|
|
|
|
$row = $_REQUEST['row'];
|
|
|
|
|
} else {
|
|
|
|
|
$row = 10;
|
|
|
|
|
}
|
|
|
|
|
$map['pay_status'] = 1;
|
|
|
|
|
if (!empty(I("game_id"))) {
|
|
|
|
|
$map['tab_spend.game_id'] = I("game_id");
|
|
|
|
|
}
|
|
|
|
|
if (!empty(I('user_account'))) {
|
|
|
|
|
$map['tab_spend.user_account'] = array('like','%'.I("user_account").'%');
|
|
|
|
|
}
|
|
|
|
|
if (!empty(I('user_nickname'))) {
|
|
|
|
|
$map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%');
|
|
|
|
|
}
|
|
|
|
|
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account,
|
|
|
|
|
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,
|
|
|
|
|
game_player_name,pay_amount,cost,pay_way";
|
|
|
|
|
$group = "";
|
|
|
|
|
$order = "pay_time DESC";
|
|
|
|
|
$join = false;
|
|
|
|
|
if ($map['pay_way'] ==-1) {//绑定币
|
|
|
|
|
$field2 = $field . ',bind_balance';
|
|
|
|
|
$join = 'left join tab_user_play as p on p.user_id = tab_spend.user_id and tab_spend.game_id=p.game_id';
|
|
|
|
|
} elseif ($map['pay_way'] ==0) {//平台币
|
|
|
|
|
$field2 = $field . ',balance';
|
|
|
|
|
$join = 'left join tab_user as u on u.id = tab_spend.user_id';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join);
|
|
|
|
|
|
|
|
|
|
foreach($data as $key => $value) {
|
|
|
|
|
$data[$key]['pay_way'] = getPayType($value['pay_way']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$count = D("spend")->getSpendData($map,$field,$group,$order);
|
|
|
|
|
$count = count($count);
|
|
|
|
|
$page = set_pagination($count,$row);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $map['pay_game_status'] = 1;
|
|
|
|
|
$total_cost = D('spend')->sumSpend($map, 'cost');//订单金额合计
|
|
|
|
|
$total_pay_amount = D('spend')->sumSpend($map, 'pay_amount');//实付金额合计
|
|
|
|
|
|
|
|
|
|
$this->assign('total_cost', $total_cost);
|
|
|
|
|
$this->assign('total_pay_amount', $total_pay_amount);
|
|
|
|
|
|
|
|
|
|
if($page) {$this->assign('_page', $page);}
|
|
|
|
|
$this->meta_title = '游戏订单查看';
|
|
|
|
|
|
|
|
|
|
$this->assign('data',$data);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|