优化结算汇总

master
chenzhi 4 years ago
parent 40005b7177
commit 9ab8454970

@ -1074,3 +1074,14 @@ function is_subsiteTable($tableName,$is_subsiteTable=false)
} }
return false; return false;
} }
/**
* 添加子站点条件
* @param [arrary] $map
* @param string $field 数据库查询字段
* @return void
*/
function addSubsiteWhere(&$map,$field){
if(IS_SUBSITE){
$map[$field] = PARTNER_TYPE;
}
}

@ -283,9 +283,7 @@ class FinancePromoteController extends AdminController
} }
$map['s.pay_status']=1; $map['s.pay_status']=1;
$map['s.is_check']=1; $map['s.is_check']=1;
if(IS_SUBSITE){ D("Spend")->addSubsiteWhere($map,"s");
$map['s.partner_type']=PARTNER_TYPE;
}
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count, SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
@ -516,9 +514,7 @@ class FinancePromoteController extends AdminController
} }
$map['s.pay_status']=1; $map['s.pay_status']=1;
$map['s.is_check']=1; $map['s.is_check']=1;
if(IS_SUBSITE){ D("Spend")->addSubsiteWhere($map,"s");
$map['s.partner_type']=PARTNER_TYPE;
}
// dd($map); // dd($map);
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
@ -608,9 +604,7 @@ class FinancePromoteController extends AdminController
$map['promote.admin_id'] = ['gt', 0]; $map['promote.admin_id'] = ['gt', 0];
$map['s.market_admin_id'] = ['gt', 0]; $map['s.market_admin_id'] = ['gt', 0];
} }
if(IS_SUBSITE){ D("Spend")->addSubsiteWhere($map,"s");
$map['s.partner_type']=PARTNER_TYPE;
}
//获取推广员 //获取推广员
$title = ''; $title = '';
self::setPromoteMap($map,"s.promote_id",$title,false); self::setPromoteMap($map,"s.promote_id",$title,false);
@ -746,9 +740,7 @@ class FinancePromoteController extends AdminController
if ($adminId > 0) { if ($adminId > 0) {
$map['market_admin_id'] = $adminId; $map['market_admin_id'] = $adminId;
} }
if(IS_SUBSITE){ D("Spend")->addSubsiteWhere($map);
$map['partner_type']=PARTNER_TYPE;
}
/* if (!empty(I('develop_type'))) { /* if (!empty(I('develop_type'))) {
$map['company.develop_type'] = I('develop_type'); $map['company.develop_type'] = I('develop_type');
} }
@ -1019,6 +1011,7 @@ class FinancePromoteController extends AdminController
if (!empty(I('user_nickname'))) { if (!empty(I('user_nickname'))) {
$map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%'); $map['tab_spend.game_player_name'] = array('like',I("user_nickname").'%');
} }
D("Spend")->addSubsiteWhere($map,"s");
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,tab_spend.user_account, $field = "pay_order_number,FROM_UNIXTIME(payed_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,tab_spend.sdk_version, tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version,
game_player_name,pay_amount,cost,pay_way"; game_player_name,pay_amount,cost,pay_way";

@ -56,15 +56,17 @@ class PayChannelController extends ThinkController
$map['pay_status'] = $coinMap['pay_status'] = 1; $map['pay_status'] = $coinMap['pay_status'] = 1;
$map['pay_way'] = array('egt',1); $map['pay_way'] = array('egt',1);
if(IS_SUBSITE){
$map['partner_type']=PARTNER_TYPE; D("Spend")->addSubsiteWhere($map);
$coinMap['tab_deposit.partner_type']=PARTNER_TYPE; D("Deposit")->addSubsiteWhere($coinMap);
} D("Deposit")->addSubsiteWhere($offcialmap);
addSubsiteWhere($maptestorder,"partner_type");
// setPowerPromoteIds($map,'promote_id'); // setPowerPromoteIds($map,'promote_id');
//游戏币计算 //游戏币计算
$data = SM('spend use index(pay_channel)','tab_',true) $data = M('spend use index(pay_channel)','tab_')
->field("game_name,sum(pay_amount) as pay_amount,game_id,sdk_version") ->field("game_name,sum(pay_amount) as pay_amount,game_id,sdk_version")
->where($map) ->where($map)
->group('game_id') ->group('game_id')
@ -100,7 +102,7 @@ class PayChannelController extends ThinkController
//测试白名单 //测试白名单
$testList = implode(",",M("test_white_list","tab_")->getField("user_id",true)); $testList = implode(",",M("test_white_list","tab_")->getField("user_id",true));
//测试数据汇总计算 //测试数据汇总计算
$testData = SM('spend','tab_') $testData = M('spend','tab_')
->field("sum(pay_amount) as test_coin,game_name,game_id") ->field("sum(pay_amount) as test_coin,game_name,game_id")
->where($map) ->where($map)
->where("user_id in ({$testList})") ->where("user_id in ({$testList})")
@ -607,6 +609,9 @@ class PayChannelController extends ThinkController
$map['pay_status'] = 1; $map['pay_status'] = 1;
D("Spend")->addSubsiteWhere($map);
D("Deposit")->addSubsiteWhere($coinMap,"tab_deposit");
D("Deposit")->addSubsiteWhere($offcialmap);
$_REQUEST['model']?$model= $_REQUEST['model']:false; $_REQUEST['model']?$model= $_REQUEST['model']:false;

@ -75,7 +75,9 @@
<div class="fr"> <div class="fr">
<a class="tabchose" href="">游戏充值统计</a> <a class="tabchose" href="">游戏充值统计</a>
<a class="" href="{:U('Finance/payTypeStatistics')}">充值方式统计</a> <a class="" href="{:U('Finance/payTypeStatistics')}">充值方式统计</a>
<if condition="!IS_SUBSITE">
<a class="" href="{:U('PayMerchant/index')}">支付商户统计</a> <a class="" href="{:U('PayMerchant/index')}">支付商户统计</a>
</if>
</div> </div>
</div> </div>
@ -244,10 +246,14 @@
<td colspan="6"> <td colspan="6">
<volist name="payTypeData" id="payTypeData" key="index"> <volist name="payTypeData" id="payTypeData" key="index">
<if condition="$key neq '其他支付金额' and $payTypeData.amount neq 0"> <if condition="$key neq '其他支付金额' and $payTypeData.amount neq 0">
<if condition="IS_SUBSITE">
{$key}{$payTypeData['amount']} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<else />
<a href="{:U('PayMerchant/index',array('pay_way'=>$payTypeData['pay_way'],'type'=>$payTypeData['type'],'timestart'=>I('timestart'),'timeend'=>I('timeend')))}"> <a href="{:U('PayMerchant/index',array('pay_way'=>$payTypeData['pay_way'],'type'=>$payTypeData['type'],'timestart'=>I('timestart'),'timeend'=>I('timeend')))}">
{$key}{$payTypeData['amount']} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp {$key}{$payTypeData['amount']} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</a> </a>
</if> </if>
</if>
</volist> </volist>
平台币直充总金额<span style="color: red">(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0.00</if> 平台币直充总金额<span style="color: red">(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0.00</if>
</td> </td>

Loading…
Cancel
Save