Merge pull request 'feature/finance_payment_20210115' (#201) from feature/finance_payment_20210115 into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/201
master
廖金灵 4 years ago
commit f3a01c4c37

@ -705,7 +705,9 @@ class FinanceController extends ThinkController
$page = $page ? $page : 1; //默认显示第一页数据
$row = $_REQUEST['row'] ?? 10;
$map = [];
$map = [
"_string" => "1 = 1"
];
$searchGameIds = null;
$game_ids = array_column(getGameByName(I("game_name"), I("sdk_type")), 'id');
@ -822,14 +824,24 @@ class FinanceController extends ThinkController
if (isset($aggData[$value['unique_code']]) && isset($aggData[$value['unique_code']][$deviceType])) {
$aggAmount = number_format($aggData[$value['unique_code']][$deviceType], 2, '.', '');
}
if (isset($aggWmData[$value['unique_code']]) && isset($aggWmData[$value['unique_code']][$deviceType])) {
$aggWmAmount = number_format($aggWmData[$value['unique_code']][$deviceType], 2, '.', '');
}
if (isset($aggFailData[$value['unique_code']]) && isset($aggFailData[$value['unique_code']][$deviceType])) {
$aggFailAmount = number_format($aggFailData[$value['unique_code']][$deviceType], 2, '.', '');
}
if (isset($aggWmData[$value['unique_code']]) && isset($aggWmData[$value['unique_code']][$deviceType])) {
$aggWmAmount = number_format($aggWmData[$value['unique_code']][$deviceType], 2, '.', '');
if(IS_SUBSITE){
$aggWmAmount = $data[$key]['cash_count']-0+$data[$key]['balance_coin_count']-0+$data[$key]['inside_cash_count'];
$aggWmTotal = $aggWmTotal -$aggWmData[$value['unique_code']][$deviceType] + $aggWmAmount;
$aggWmAmount = number_format($aggWmAmount, 2, '.', '');
}
}
if (isset($aggWmFailData[$value['unique_code']]) && isset($aggWmFailData[$value['unique_code']][$deviceType])) {
$aggWmFailAmount = number_format($aggWmFailData[$value['unique_code']][$deviceType], 2, '.', '');
if(IS_SUBSITE){
$aggWmFailAmount = $data[$key]['notice_fail_count'];
$aggWmFailTotal = $aggWmFailTotal -$aggWmFailData[$value['unique_code']][$deviceType] + $aggWmFailAmount;
$aggWmFailAmount = number_format($aggWmFailAmount, 2, '.', '');
}
}
}
if (isset($gameSets[$value['game_id']]) && isAggGame($gameSets[$value['game_id']]['pay_notify_url'])) {
@ -886,14 +898,18 @@ class FinanceController extends ThinkController
//统计合计
if (count($exceptIds) > 0) {
if (isset($map['_string'])) {
$map['_string'] .= " and s.game_id not in (" . implode(',', $exceptIds) . ")";
} else {
$map['_string'] = " s.game_id not in (" . implode(',', $exceptIds) . ")";
if(IS_SUBSITE){
$wmtotalMap = $map;
$wmtotalMap['_string'] .= " and s.game_id in (" . implode(',', $exceptIds) . ")";
}
$map['_string'] .= " and s.game_id not in (" . implode(',', $exceptIds) . ")";
}
$totalData = D("spend")->totalGameStatistics($map,$searchGameIds);
if(IS_SUBSITE){
$wmTotalData = D("spend")->totalWmGameStatistics($wmtotalMap,$searchGameIds);
$aggWmTotal = $wmTotalData['aggwmtotal']??0;
$aggWmFailTotal = $wmTotalData['aggwmfailtotal']??0;
}
$sumCash = $totalData['cash_count'];
$sumBalance = $totalData['balance_coin_count'];
$sumInside = $totalData['inside_cash_count'];

@ -947,5 +947,25 @@ class SpendModel extends Model
return $data;
}
/**
*获取聚合万盟数据
*/
public function totalWmGameStatistics($map,$gameIds)
{
if($gameIds){
$map['s.game_id'] = ['in', $gameIds];
}
$data = M("Spend","tab_")
->alias('s')
->index('game_time')
->field("
SUM(CASE WHEN pay_game_status = 1 THEN pay_amount ELSE 0 END) as aggwmtotal,
SUM(CASE WHEN pay_game_status = 0 THEN pay_amount ELSE 0 END) as aggwmfailtotal")
->where(['s.pay_status' => 1])
->where($map)
->find();
return $data;
}
}

@ -237,15 +237,21 @@
false))}"><if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td>
<td ><if condition="$data.all_cash_count neq ''">{$data.all_cash_count}<else/>0</if></td>
<td ><span style="color:red;"><if condition="$data.notice_fail_count neq ''">{$data.notice_fail_count}<else/>0</if></span></td>
<td ><a href="{:U('Finance/aggDetail', [
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_id'=>$data['game_id'],
'game_name'=>$data['game_name'],
'partner_id'=>$_REQUEST['partner_id'],
'channel_type'=>1,
])}">{$data.agg_wm_amount}</a></td>
<td >
<if condition="!IS_SUBSITE">
<a href="{:U('Finance/aggDetail', [
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_id'=>$data['game_id'],
'game_name'=>$data['game_name'],
'partner_id'=>$_REQUEST['partner_id'],
'channel_type'=>1,
])}">{$data.agg_wm_amount}</a>
<else />
{$data.agg_wm_amount}
</if>
</td>
<td ><span style="color:red;"><if condition="$data.agg_wm_failed_amount neq ''">{$data.agg_wm_failed_amount}<else/>0</if></span></td>
<td ><span style="color:red;">
<a href="{:U('TestOrder/lists', [

Loading…
Cancel
Save