diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php
index e27ed0c5d..050908ab7 100644
--- a/Application/Admin/Controller/FinancePromoteController.class.php
+++ b/Application/Admin/Controller/FinancePromoteController.class.php
@@ -345,7 +345,11 @@ class FinancePromoteController extends AdminController
$map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399];
}
//判断是否有推广员
+ $level = 1;
if ($_REQUEST['promote_id'] != '') {
+ if ($_REQUEST['promote_id'] != 0){
+ $level = M('promote', 'tab_')->field('level')->where(array('id' => $_REQUEST['promote_id']))->find()['level'];
+ }
if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) {
$map['s.promote_id'] = $_REQUEST['promote_id'];
} else {
@@ -355,6 +359,7 @@ class FinancePromoteController extends AdminController
}
}
}
+ $this->assign('promote_level', $level);
//游戏统计列表
$data =self::gameStatisticsData($map, $row, $p);
@@ -388,6 +393,18 @@ class FinancePromoteController extends AdminController
//游戏订单详情
public function gameStatisticsDetail($p = 1) {
set_time_limit(0);
+ if(isset($_REQUEST['game_id'])){
+
+ //转化为名称和类型,重新请求
+ $game = M("game","tab_")->field("relation_game_name,sdk_version")->where(" id = {$_REQUEST['game_id']} ")->find();
+ if($game === false){
+ $this->error("参数错误");
+ }
+ $_GET['game_name'] = $game['relation_game_name'];
+ $_GET['game_type'] = $game['sdk_version'];
+ unset($_GET['game_id']);
+ $this->redirect(ACTION_NAME, I('get.'));
+ }
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
@@ -396,13 +413,16 @@ class FinancePromoteController extends AdminController
if (!empty($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
-
- if (!empty(I('partner_id'))&&empty(I("game_id"))) {
+
+ if (!empty(I('partner_id'))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
+ if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
+ $map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
+ }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];
@@ -423,9 +443,6 @@ class FinancePromoteController extends AdminController
}
}
}
- // if (!empty(I("promote_id"))) {
- // $promote_id[] = I("promote_id");
- // }
if (!empty(I("root_id"))) {
$root_id = I("root_id");
@@ -459,7 +476,6 @@ class FinancePromoteController extends AdminController
if (!empty(I('user_nickname'))) {
$map['game_player_name'] = array('like',I("user_nickname").'%');
}
- // var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
@@ -468,7 +484,7 @@ class FinancePromoteController extends AdminController
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
- $totalData = D('spend')->totalGameStatistics($map, false);
+ $totalData = self::totalGameStatisticsData($map, false);
$sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0;
$sumInside = $totalData['inside_cash_count'] ?? 0;
@@ -507,6 +523,7 @@ class FinancePromoteController extends AdminController
$query = $query->page($page,$row);
}
$data = $query->select();
+ // dump($data);die();
return $data;
}
private function totalGameStatisticsData($map, $join = true)
@@ -519,7 +536,7 @@ class FinancePromoteController extends AdminController
$query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id');
}
- $data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1])
+ $data = $query->where(['s.pay_status' => 1])
->where($map)
->find();
return $data;
diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html
index b6f999bb0..2adaefccd 100644
--- a/Application/Admin/View/FinancePromote/gameStatistics.html
+++ b/Application/Admin/View/FinancePromote/gameStatistics.html
@@ -82,7 +82,7 @@
+