master
ELF 3 years ago
parent 50bed5329c
commit c39fecad01

@ -872,6 +872,7 @@ class FinanceController extends ThinkController
'balance_coin_count'=>'平台币直充支出',
'inside_cash_count'=>'内充支出',
'all_cash_count'=>'游戏内充值合计',
'discount_amount'=>'优惠金额',
'notice_fail_count'=>'联运通知失败合计',
'agg_wm_amount'=>'聚合万盟数据',
'agg_wm_failed_amount'=>'聚合万盟通知失败',
@ -915,6 +916,7 @@ class FinanceController extends ThinkController
$sumInside = $totalData['inside_cash_count'];
$sumNoticeFail = $totalData['notice_fail_count']? $totalData['notice_fail_count']:0;
$sumAll = $sumCash + $sumBalance + $sumInside;
$sumDiscountAmount = $totalData['discount_amount'];
$game_types = M("game_type", 'tab_')->field('id, type_name')->select();
@ -928,6 +930,7 @@ class FinanceController extends ThinkController
$this->assign('aggWmTotal', $aggWmTotal);
$this->assign('aggTotal', $aggTotal);
$this->assign('game_types', $game_types);
$this->assign('sumDiscountAmount', $sumDiscountAmount);
$this->assign('sumCash', $sumCash);
$this->assign('sumBalance', $sumBalance);
$this->assign('sumInside', $sumInside);
@ -1086,7 +1089,7 @@ class FinanceController extends ThinkController
D("Spend")->addSubsiteWhere($map);
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version,merchant_id";
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,discount_amount,cost,pay_way,sdk_version,merchant_id";
$group = "";
$order = "payed_time DESC";
@ -1133,6 +1136,7 @@ class FinanceController extends ThinkController
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"discount_amount"=>'折扣',
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式",
"merchant_name"=>"所属商户"

@ -133,6 +133,7 @@ class FinancePromoteController extends AdminController
"balance_coin_count"=>0,
"bind_coin_count"=>0,
"inside_cash_count"=>0,
"discount_amount"=>0,
);
$promotes = [];
if (count($senddata) > 0) {
@ -155,6 +156,7 @@ class FinancePromoteController extends AdminController
if(!array_key_exists('balance_coin_count',$v)) $v['balance_coin_count']=0;
if(!array_key_exists('bind_coin_count',$v)) $v['bind_coin_count']=0;
if(!array_key_exists('inside_cash_count',$v)) $v['inside_cash_count']=0;
if(!array_key_exists('discount_amount',$v)) $v['discount_amount']=0;
$v['promote_account'] = get_promote_name($v['p_id']);
($v['promote_account']=='官方渠道')?($v['promote_account']=C('OFFICIEL_CHANNEL')):'';
$v['admin_username'] = $adminUsernames[$promote['admin_id']] ?? '无';
@ -169,6 +171,7 @@ class FinancePromoteController extends AdminController
$count['inside_cash_count'] += $v['inside_cash_count'];
$count['all_count'] += $v['allcount'];
$count['unallcount'] += $v['unallcount'];
$count['discount_amount'] += $v['discount_amount'];
$data[] = $v;
}
$data = my_sort($data, $data_order_type, (int)$data_order);
@ -191,6 +194,7 @@ class FinancePromoteController extends AdminController
"inside_cash_count"=>"平台币内充",
"allcount"=>"渠道游戏内充值合计",
"unallcount"=>"渠道游戏内不结算充值合计",
"discount_amount"=>"优惠金额",
));
}
// dump($data);die();
@ -220,6 +224,7 @@ class FinancePromoteController extends AdminController
$count['bind_coin_count'] = number_format($count['bind_coin_count'],2,'.','');
$count['inside_cash_count'] = number_format($count['inside_cash_count'],2,'.','');
$count['all_count'] = number_format($count['all_count'],2,'.','');
$count['discount_amount'] = number_format($count['discount_amount'],2,'.','');
$this->checkListOrCountAuthRestMap($map,[]);
@ -295,6 +300,7 @@ class FinancePromoteController extends AdminController
$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 = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
SUM(discount_amount) as discount_amount,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,
IFNULL(company_id,0) company_id,company_name,develop_type,IFNULL(promote.company_belong,0) company_belong";
$query = SM()
@ -370,6 +376,7 @@ class FinancePromoteController extends AdminController
$field= "SUM(CASE WHEN pay_way > 0 and s.is_check=1 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 and s.is_check=1 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 and s.is_check=1 THEN pay_amount ELSE 0 END) as bind_coin_count,
SUM(discount_amount) as discount_amount,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,
IFNULL(company_id,0) company_id,company_name,develop_type,IFNULL(promote.company_belong,0) company_belong";
$query = SM()
@ -484,6 +491,7 @@ class FinancePromoteController extends AdminController
"balance_coin_count"=>0,
"bind_coin_count"=>0,
"inside_cash_count"=>0,
"discount_amount"=>0,
);
$marketAdmins = [];
@ -525,6 +533,7 @@ class FinancePromoteController extends AdminController
$allcount['bind_coin_count'] += $v['bind_coin_count'];
$allcount['inside_cash_count'] += $v['inside_cash_count'];
$allcount['all_count'] += $v['allcount'];
$allcount['discount_amount'] += $v['discount_amount'];
$data[] = $v;
}
@ -533,6 +542,7 @@ class FinancePromoteController extends AdminController
$allcount['bind_coin_count'] = number_format($allcount['bind_coin_count'],2,'.','');
$allcount['inside_cash_count'] = number_format($allcount['inside_cash_count'],2,'.','');
$allcount['all_count'] = number_format($allcount['all_count'],2,'.','');
$allcount['discount_amount'] = number_format($allcount['discount_amount'],2,'.','');
$data = my_sort($data, $data_order_type, (int)$data_order);
if(isset($_REQUEST['export'])){
@ -552,7 +562,8 @@ class FinancePromoteController extends AdminController
"balance_coin_count"=>"平台币直充支出",
"bind_coin_count"=>"内充支出",
"inside_cash_count"=>"平台币内充",
"allcount"=>"渠道游戏内充值合计"
"allcount"=>"渠道游戏内充值合计",
"discount_amount"=>"优惠金额",
));
}
@ -603,6 +614,7 @@ class FinancePromoteController extends AdminController
$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 = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
SUM(discount_amount) as discount_amount,
IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,develop_type,IFNULL(promote.company_belong,0) company_belong";
$query = SM()
->table("tab_spend s use index(promote_time)")
@ -744,7 +756,8 @@ class FinancePromoteController extends AdminController
"cash_count"=>"游戏现金金额",
"balance_coin_count"=>"平台币直充支出",
"inside_cash_count"=>"内充支出",
"all_cash_count"=>"游戏内充值合计"
"all_cash_count"=>"游戏内充值合计",
"discount_amount"=>"优惠金额",
));
}
@ -763,11 +776,13 @@ class FinancePromoteController extends AdminController
$sumCash = $totalData['cash_count'];
$sumBalance = $totalData['balance_coin_count'];
$sumInside = $totalData['inside_cash_count'];
$sumDiscount = $totalData['discount_amount'];
$sumAll = number_format($sumCash + $sumBalance + $sumInside,2,'.','');
$departments = M('department', 'sys_')->select();
$this->assign('departments', $departments);
$this->assign('sumCash', $sumCash);
$this->assign('sumDiscount', $sumDiscount);
$this->assign('sumBalance', $sumBalance);
$this->assign('sumInside', $sumInside);
$this->assign('sumAll', $sumAll);
@ -864,7 +879,7 @@ class FinancePromoteController extends AdminController
$map['merchant_id'] = $_REQUEST['merchant_id'];
}
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,sdk_version,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,market_admin_id,merchant_id";
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,sdk_version,promote_account,spend_ip,server_name,game_player_name,pay_amount,discount_amount,cost,pay_way,market_admin_id,merchant_id";
$group = "";
$order = "pay_time DESC";
if(isset($_REQUEST['export'])){
@ -924,6 +939,7 @@ class FinancePromoteController extends AdminController
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"discount_amount"=>"折扣",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式",
"merchant_name"=>"所属商户",
@ -976,6 +992,7 @@ class FinancePromoteController extends AdminController
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 = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,
SUM(discount_amount) as discount_amount,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,
IFNULL(company_name,'{$this->COMPANY_NAME}') company_name,develop_type,IFNULL(promote.company_belong,0) company_belong")
->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
@ -1012,7 +1029,8 @@ class FinancePromoteController extends AdminController
$query = SM("spend","tab_")->alias("s")
->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 = -1 THEN pay_amount ELSE 0 END) as inside_cash_count");
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,
SUM(discount_amount) as discount_amount");
if ($join) {
$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')

@ -924,12 +924,14 @@ class SpendModel extends Model
SUM(CASE WHEN pay_way > 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as inside_cash_count,
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 0 THEN pay_amount ELSE 0 END) as notice_fail_count");
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 0 THEN pay_amount ELSE 0 END) as notice_fail_count,
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 1 THEN discount_amount ELSE 0 END) discount_amount");
$base = [
'cash_count' => "0.00",
'balance_coin_count' => "0.00",
'inside_cash_count' => "0.00",
'notice_fail_count' => "0.00"
'notice_fail_count' => "0.00",
'discount_amount' => "0.00"
];
$records = [];
foreach ($games as $game) {
@ -963,7 +965,8 @@ class SpendModel extends Model
SUM(CASE WHEN pay_way > 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as inside_cash_count,
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 0 THEN pay_amount ELSE 0 END) as notice_fail_count")
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 0 THEN pay_amount ELSE 0 END) as notice_fail_count,
SUM(CASE WHEN s.pay_status = 1 and pay_game_status = 1 THEN discount_amount ELSE 0 END) discount_amount")
->where(['s.pay_status' => 1])
->where($map)
->find();

@ -163,7 +163,12 @@
</div>
</div>
<style>
.data_list table th {
height: 24px;
line-height: 24px;
}
</style>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
@ -186,12 +191,15 @@
<th ><div class="tooltip">内充支出<span class="tooltiptext"><span style="margin-left: -10px">玩家用绑币购买游戏道具所产生的金额</span></span></div></th>
<th ><div class="tooltip">游戏内充值合计<span class="tooltiptext"><span style="margin-left: -10px">游戏现金金额+平台币直充支出+平台币内充支出</span></span></div></th>
<th ><div class="tooltip">优惠金额<span class="tooltiptext"><span style="margin-left: -10px">游戏折扣和代金券优惠金额</span></span></div></th>
<th ><div class="tooltip"><span style="color: red">联运通知失败合计</span><span class="tooltiptext"><span style="margin-left: -10px">联运所有通知失败的合计金额</span></span></div></th>
<th ><div class="tooltip">聚合万盟数据<span class="tooltiptext"><span style="margin-left: -10px">聚合平台万盟渠道支付成功且通知成功的金额</span></span></div></th>
<th ><div class="tooltip"><span style="color: red">聚合万盟通知失败</span><span class="tooltiptext"><span style="margin-left: -10px">聚合平台万盟渠道通知失败的订单合计金额</span></span></div></th>
<th ><div class="tooltip"><span style="color: red">聚合平台测试订单</span><span class="tooltiptext"><span style="margin-left: -10px">聚合平台测试订单</span></span></div></th>
<th ><div class="tooltip">聚合其他渠道数据<span class="tooltiptext"><span style="margin-left: -10px">聚合平台其他渠道(不含万盟)支付成功通知成功订单合计</span></span></div></th>
<th ><div class="tooltip"><span style="color: red">聚合其他渠道通知失败订单</span><span class="tooltiptext"><span style="margin-left: -10px">聚合平台其他渠道(不含万盟)<br>通知失败的订单合计金额</span></span></div></th>
<th ><div class="tooltip"><span style="color: red">聚合其他渠道<br/>通知失败订单</span><span class="tooltiptext"><span style="margin-left: -10px">聚合平台其他渠道(不含万盟)<br>通知失败的订单合计金额</span></span></div></th>
<th >操作</th>
</tr>
</thead>
@ -236,6 +244,7 @@
'pay_way'=>-1,
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 ><if condition="$data.discount_amount neq ''">{$data.discount_amount}<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 >
<if condition="!IS_SUBSITE">
@ -290,6 +299,7 @@
<td><if condition="$sumBalance neq ''">{$sumBalance}<else/>0</if></td>
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td><if condition="$sumDiscountAmount neq ''">{$sumDiscountAmount}<else/>0</if></td>
<td><span style="color: red"><if condition="$sumNoticeFail neq ''">{$sumNoticeFail}<else/>0</if></span></td>
<td>{$aggWmTotal}</td>
<td><span style="color: red"><if condition="$aggWmFailTotal neq ''">{$aggWmFailTotal}<else/>0</if></span></td>

@ -137,6 +137,8 @@
<th >订单金额</th>
<th >折扣</th>
<th >实付金额</th>
<th >充值方式</th>
@ -169,6 +171,7 @@
<td >{$data.server_name}</td>
<td >{$data.game_player_name}</td>
<td >{$data.cost}</td>
<td >{$data.discount_amount}</td>
<td >{$data.pay_amount}</td>
<td >{$data.pay_way}</td>
<td >{$data.merchant_name}</td>

@ -219,6 +219,8 @@
<th ><div class="tooltip">游戏内充值合计<span class="tooltiptext"><span style="margin-left: -10px">游戏现金金额+平台币直充支出+平台币内充支出</span></span></div></th>
<th ><div class="tooltip">优惠金额<span class="tooltiptext"><span style="margin-left: -10px">游戏折扣和代金券优惠金额</span></span></div></th>
<th >操作</th>
</tr>
</thead>
@ -251,6 +253,7 @@
{$data.inside_cash_count}
</td>
<td >{$data.all_cash_count}</td>
<td >{$data.discount_amount}</td>
<td >
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'promote_id'=>$data['p_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level,'p'=>1,'row'=>10]))}" >订单查看</a>
</td>
@ -262,6 +265,7 @@
<td><if condition="$sumBalance neq ''">{$sumBalance}<else/>0</if></td>
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td><if condition="$sumDiscount neq ''">{$sumDiscount}<else/>0</if></td>
<td>
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['promote_level'=>1,'p'=>1,'row'=>10]))}" >订单查看</a>
</td>

@ -200,6 +200,8 @@
<th >角色名称</th>
<th >订单金额</th>
<th >折扣</th>
<th >实付金额</th>
@ -235,6 +237,7 @@
<td >{$data.server_name}</td>
<td >{$data.game_player_name}</td>
<td >{$data.cost}</td>
<td >{$data.discount_amount}</td>
<td >{$data.pay_amount}</td>
<td >{$data.pay_way}</td>
<td >{$data.merchant_name}</td>
@ -242,7 +245,7 @@
</volist>
<tr>
<td ><span>总计</span></td>
<td colspan="14" ><span><if condition="$sumAll neq ''">累计充值:{$sumAll}<else/>0</if>
<td colspan="99" ><span><if condition="$sumAll neq ''">累计充值:{$sumAll}<else/>0</if>
(现金金额:{$sumCash} 平台币:{$sumBalance} 绑币:{$sumInside}
</span></td>
</tr>

@ -248,9 +248,9 @@
<else />平台币内充<img src="__IMG__/up-down.png" width="13px">
</if>
</a> <span class="tooltiptext">管理后台直接下放给会长的平台币,因存在平台币回收,所以可能会存在负值</span> </th>
<th class="tooltip">渠道游戏内充值合计 <span class="tooltiptext">游戏现金金额(游戏现金流水+平台币支出+公会内充支出=总流水)</span>
<th class="tooltip">渠道游戏内不结算充值合计 <span class="tooltiptext">游戏现金金额(游戏不结算现金流水)</span>
</th>
<th class="tooltip">渠道游戏内充值合计 <span class="tooltiptext">游戏现金金额(游戏现金流水+平台币支出+公会内充支出=总流水)</span></th>
<th class="tooltip">渠道游戏内不结算充值合计 <span class="tooltiptext">游戏现金金额(游戏不结算现金流水)</span></th>
<th class="tooltip">优惠金额 <span class="tooltiptext">游戏折扣和代金券优惠金额</span></th>
<if condition="!IS_SUBSITE">
<th>操作</th>
</if>
@ -295,7 +295,7 @@
data-value="{$data['id']}"><a>{$data.inside_cash_count}</a></span></td> -->
<td>{$data.allcount}</td>
<td style="color: red;">{$data.unallcount}</td>
<td style="color: red;">{$data.discount_amount}</td>
<if condition="!IS_SUBSITE">
<td>
<a
@ -321,6 +321,7 @@
<td style="text-align: center;">{$all_count['inside_cash_count']}</td>
<td style="text-align: center;">{$all_count['all_count']}</td>
<td style="text-align: center;color: red;">{$all_count['unallcount']}</td>
<td style="text-align: center;color: red;">{$all_count['discount_amount']}</td>
<if condition="!IS_SUBSITE">
<td style="text-align: center;">
<a

@ -224,6 +224,7 @@
</if>
</a> <span class="tooltiptext">管理后台直接下放给会长的平台币,因存在平台币回收,所以可能会存在负值</span> </th>
<th class="tooltip">渠道游戏内充值合计 <span class="tooltiptext">游戏现金金额(游戏现金流水+平台币支出+公会内充支出=总流水</span> </th>
<th class="tooltip">优惠金额 <span class="tooltiptext">游戏折扣和代金券优惠金额</span> </th>
<th>操作</th>
</tr>
</thead>
@ -245,7 +246,7 @@
<td>{$data.bind_coin_count}</td>
<td>{$data.inside_cash_count}</td>
<td>{$data.allcount}</td>
<td>{$data.discount_amount}</td>
<td>
<a href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_id'=>$data['promote_id'],'company_id'=>$data['company_id'],'promote_type'=>2,'p'=>1]))}" >游戏查看</a>
@ -261,6 +262,7 @@
<td style="text-align: center;">{$all_count['bind_coin_count']}</td>
<td style="text-align: center;">{$all_count['inside_cash_count']}</td>
<td style="text-align: center;">{$all_count['all_count']}</td>
<td style="text-align: center;">{$all_count['discount_amount']}</td>
<td style="text-align: center;">
<!-- <a href="{:U('FinancePromote/gameStatistics',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id'],'promote_type'=>2],I('get.')))}" >游戏查看</a> -->
</td>

Loading…
Cancel
Save