@ -755,19 +755,6 @@ class FinanceController extends ThinkController
public function gameStatisticsDetail($p = 1) {
public function gameStatisticsDetail($p = 1) {
set_time_limit(0);
set_time_limit(0);
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['promote_id'] = $_REQUEST['root_id'];
}
if (isset($_REQUEST['pay_way'])) {
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
$map['pay_way'] = $_REQUEST['pay_way'];
@ -777,17 +764,6 @@ class FinanceController extends ThinkController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
}
if (!empty(I("parent_id"))) {
$parent_id = I("parent_id");
$promote_id = $this->getPromoteList($parent_id);
array_push($promote_id,$parent_id);
}
$promote_id = implode(',',$promote_id);
if ($promote_id) {
$map['promote_id'] = ['in',$promote_id];
}
if (!empty(I('partner_id'))& & empty(I("game_id"))) {
if (!empty(I('partner_id'))& & empty(I("game_id"))) {
$wherePartner = I('partner_id');
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
@ -807,17 +783,11 @@ class FinanceController extends ThinkController
// var_dump($map);die();
// var_dump($map);die();
$page = intval($p);
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$page = $page ? $page : 1; //默认显示第一页数据
$row=10;
if (isset($_REQUEST['row'])) {
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
$row = $_REQUEST['row'];
} else {
if (!empty(I("count_date"))) {
$row = 10;
$month = I("count_date");
$tarry = explode('-',$month);
$startTime=mktime(0,0,0,$tarry[1],1,$tarry[0]);
$endTime =mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1;
$map['pay_time'] = array('between',array($startTime,$endTime));
}
}
$map['pay_status'] = 1;
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
$map['game_id'] = I("game_id");
@ -833,16 +803,14 @@ class FinanceController extends ThinkController
$group = "";
$group = "";
$order = "pay_time DESC";
$order = "pay_time DESC";
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
// echo D("spend")->_sql();die();
foreach($data as $key => $value) {
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
}
$totalData = D('spend')->totalGameStatistics($map, false);
$totalData = D('spend')->totalGameStatistics($map, false);
$sumCash = $totalData['cash_count'];
$sumCash = $totalData['cash_count'] ?? 0 ;
$sumBalance = $totalData['balance_coin_count'];
$sumBalance = $totalData['balance_coin_count'] ?? 0 ;
$sumInside = $totalData['inside_cash_count'];
$sumInside = $totalData['inside_cash_count'] ?? 0 ;
$sumAll = $sumCash + $sumBalance + $sumInside;
$sumAll = $sumCash + $sumBalance + $sumInside;
$this->assign('sumCash', $sumCash);
$this->assign('sumCash', $sumCash);