|
|
@ -707,9 +707,11 @@ class FinanceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
$map = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$searchGameIds = null;
|
|
|
|
$game_ids = array_column(getGameByName(I("game_name"), I("sdk_type")), 'id');
|
|
|
|
$game_ids = array_column(getGameByName(I("game_name"), I("sdk_type")), 'id');
|
|
|
|
if ($game_ids) {
|
|
|
|
if ($game_ids) {
|
|
|
|
$map['s.game_id'] = ['in', $game_ids];
|
|
|
|
$map['s.game_id'] = ['in', $game_ids];
|
|
|
|
|
|
|
|
$searchGameIds = $game_ids;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty(I('partner_id'))) {
|
|
|
|
if (!empty(I('partner_id'))) {
|
|
|
@ -731,10 +733,13 @@ class FinanceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty(I('game_type_id'))) {
|
|
|
|
if (!empty(I('game_type_id'))) {
|
|
|
|
$map['g.game_type_id'] = I('game_type_id');
|
|
|
|
$map['g.game_type_id'] = I('game_type_id');
|
|
|
|
|
|
|
|
$searchGameIds = M('game', 'tab_')->where(['game_type_id' => I('game_type_id', 0)])->getField('id', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$startTime = time();
|
|
|
|
$startTime = time();
|
|
|
|
//游戏统计列表
|
|
|
|
//游戏统计列表
|
|
|
|
$data = D("spend")->gameStatistics($map, $row, $p);
|
|
|
|
$data = D("spend")->gameStatistics($map, $row, $p);
|
|
|
|
|
|
|
|
$gameIds = array_column($data, 'game_id');
|
|
|
|
$uniqueCodes = array_column($data, 'unique_code');
|
|
|
|
$uniqueCodes = array_column($data, 'unique_code');
|
|
|
|
$uniqueCodes = array_filter($uniqueCodes, function($value) {
|
|
|
|
$uniqueCodes = array_filter($uniqueCodes, function($value) {
|
|
|
|
if ($value) {
|
|
|
|
if ($value) {
|
|
|
@ -743,8 +748,32 @@ class FinanceController extends ThinkController
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$gameSets = [];
|
|
|
|
|
|
|
|
if (count($gameIds) > 0) {
|
|
|
|
|
|
|
|
$gameSets = M('game_set', 'tab_')->field(['game_id', 'pay_notify_url'])->where(['game_id' => ['in', $gameIds]])->select();
|
|
|
|
|
|
|
|
$gameSets = index_by_column('game_id', $gameSets);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$searchGameCodes = [];
|
|
|
|
|
|
|
|
if (count($searchGameIds) > 0) {
|
|
|
|
|
|
|
|
$searchGameCodes = M('game', 'tab_')->where(['id' => ['in', $searchGameIds], 'unique_code' => ['neq', '']])->getField('unique_code', true);
|
|
|
|
|
|
|
|
$searchGameCodes = array_unique($searchGameCodes);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var_dump([
|
|
|
|
|
|
|
|
'unique_codes' => $uniqueCodes,
|
|
|
|
|
|
|
|
'started_at' => I('timestart', ''),
|
|
|
|
|
|
|
|
'ended_at' => I('timeend', ''),
|
|
|
|
|
|
|
|
'search_games' => $searchGameCodes,
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$client = new AggregateClient();
|
|
|
|
$client = new AggregateClient();
|
|
|
|
$result = $client->api('game-data', ['unique_codes' => $uniqueCodes, 'started_at' => I('timestart', ''), 'ended_at' => I('timeend', '')]);
|
|
|
|
$result = $client->api('game-data', [
|
|
|
|
|
|
|
|
'unique_codes' => $uniqueCodes,
|
|
|
|
|
|
|
|
'started_at' => I('timestart', ''),
|
|
|
|
|
|
|
|
'ended_at' => I('timeend', ''),
|
|
|
|
|
|
|
|
'search_games' => $searchGameCodes,
|
|
|
|
|
|
|
|
]);
|
|
|
|
$aggData = [];
|
|
|
|
$aggData = [];
|
|
|
|
$aggTotal = '0.00';
|
|
|
|
$aggTotal = '0.00';
|
|
|
|
if ($result['code'] == '0000') {
|
|
|
|
if ($result['code'] == '0000') {
|
|
|
@ -760,7 +789,8 @@ class FinanceController extends ThinkController
|
|
|
|
if ($value['unique_code'] && isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) {
|
|
|
|
if ($value['unique_code'] && isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) {
|
|
|
|
$aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', '');
|
|
|
|
$aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($aggAmount != '0.00') {
|
|
|
|
// if ($aggAmount != '0.00') {
|
|
|
|
|
|
|
|
if (isset($gameSets[$value['game_id']]) && isAggGame($gameSets[$value['game_id']]['pay_notify_url'])) {
|
|
|
|
$data[$key]['cash_count'] = $value['cash_count'] = 0;
|
|
|
|
$data[$key]['cash_count'] = $value['cash_count'] = 0;
|
|
|
|
$data[$key]['balance_coin_count'] = $value['balance_coin_count'] = 0;
|
|
|
|
$data[$key]['balance_coin_count'] = $value['balance_coin_count'] = 0;
|
|
|
|
$data[$key]['inside_cash_count'] = $value['inside_cash_count'] = 0;
|
|
|
|
$data[$key]['inside_cash_count'] = $value['inside_cash_count'] = 0;
|
|
|
|