管理后台-财务管理-游戏统计-添加元素

master
zhengyongxing 5 years ago
parent 322b4b6cee
commit fcc7bf2aaa

@ -757,6 +757,7 @@ class FinanceController extends ThinkController
$sumCash = $totalData['cash_count'];
$sumBalance = $totalData['balance_coin_count'];
$sumInside = $totalData['inside_cash_count'];
$sumNoticeFail = $totalData['notice_fail_count'];
$sumAll = $sumCash + $sumBalance + $sumInside;
$game_types = M("game_type", 'tab_')->field('id, type_name')->select();
@ -764,6 +765,7 @@ class FinanceController extends ThinkController
$this->assign('sumCash', $sumCash);
$this->assign('sumBalance', $sumBalance);
$this->assign('sumInside', $sumInside);
$this->assign('sumNoticeFail', $sumNoticeFail);
$this->assign('sumAll', $sumAll);
$this->assign('data',$data);

@ -841,7 +841,7 @@ class SpendModel extends Model
public function gameStatistics($map, $row = 0, $page = 1)
{
$noticeFailData = M("Spend s use index(game_time)","tab_")
->field("SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as notice_fail_count,game_id")
->field("SUM(pay_amount) as notice_fail_count,game_id")
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
->where($map)
->group('s.game_id')
@ -884,10 +884,18 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,g.sd
*/
public function totalGameStatistics($map, $join = true)
{
$noticeFailData = M("Spend s use index(game_time)","tab_")
->field("SUM(pay_amount) as notice_fail_count,game_id")
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
->where($map)
->select(false);
$query = M("Spend s use index(game_time)","tab_")
->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,notice_fail_count")
->join("LEFT JOIN ({$noticeFailData})a ON s.game_id = a.game_id");
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');

@ -175,6 +175,8 @@
<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 >操作</th>
</tr>
</thead>
@ -219,6 +221,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 ><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/gameStatisticsDetail',array(
'timestart'=>$_GET['timestart'],
@ -237,6 +240,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><span style="color: red"><if condition="$sumAll neq ''">{$sumNoticeFail}<else/>0</if></span></td>
<td>
<a href="{:U('Finance/gameStatisticsDetail',
array(

Loading…
Cancel
Save