@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <style type="text/css">
        .table th {
            padding: 0.8375rem;
            vertical-align: top;
            border-top: 1px solid #ebedf2;
        }
    </style>
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    {{ __('auto.全局报表') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.全局报表') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.全局报表') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.全局报表') }}</h4>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="6%">{{ __('auto.休眠用户：') }}{{ $accounts['dormancyUser'] }}</th>
                                    <th width="6%">{{ __('auto.流失用户：') }}{{ $accounts['lsUser'] }}</th>
                                    <th width="6%">{{ __('auto.总注册用户：') }}{{ $accounts['register'] }}</th>
                                    <th width="6%">{{ __('auto.总付费用户：') }}{{ $accounts['payUserCount'] }}</th>
                                    <th width="6%">{{ __('auto.总充值金额：') }}{{ $accounts['paySum'] }}</th>
                                    <th width="6%">{{ __('auto.累计茶叶金额：') }}{{ $accounts['withdraw'] }}</th>
                                    <th width="6%">{{ __('auto.累计茶叶回收金额：') }}{{ $accounts['withDrawRecovery'] }}</th>

                                </tr>
                                <tr>
                                    <th width="6%">{{ __('auto.赠送总金豆：') }}{{ $games['gameInfo']->Handsel ??0 }}</th>
                                    <th width="6%">{{ __('auto.签到总奖励：') }}{{ $accounts['totalSignIn'] }}</th>
                                    <th width="6%">{{ __('auto.总流水：') }}{{ $games['gameInfo']->flowing_water ??0 }}</th>
                                    <th width="6%">N{{ __('auto.总流水：') }}{{ $games['gameInfo']->flowing_water_new ??0 }}</th>
                                    <th width="6%">{{ __('auto.平台总输赢：') }}{{ $games['gameInfo']->Score ?? 0 }}</th>
                                </tr>
                                </thead>
                            </table>
                            <h4 class="card-title">{{ __('auto.库存报表') }}</h4>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="6%">{{ __('auto.房间总库存：') }}{{ $games['roomStock'] }}</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">

                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <form class="well form-inline margin-top-20" method="post" action='/admin/global/report'>
                                @csrf
                                <spen style="padding-left: 10px">{{ __('auto.选择时间：') }}</spen>
                                <input type="datetime-local" step="01" name="start_time" class="form-control"
                                       value="{{$start_time}}"/>&nbsp;&nbsp;
                                <input type="datetime-local" step="01" name="end_time" class="form-control"
                                       value="{{$end_time}}"/>&nbsp;&nbsp;
                                <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.查询') }}"/>&nbsp;&nbsp;
                                <a href="/admin/global/report"
                                   class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                                <select class="form-control" name="date" style="color: black">
                                    <option value="">{{ __('auto.选择时间') }}</option>
                                    <option value="1">{{ __('auto.今日') }}</option>
                                    <option value="2">{{ __('auto.昨日') }}</option>
                                    <option value="3">{{ __('auto.本周') }}</option>
                                    <option value="4">{{ __('auto.本月') }}</option>
                                </select>
                            </form>
                            <table class="table table-bordered" style="margin-top: 10px;">
                                <tr>
                                    <td >
                                        {{ __('auto.注册用户：') }}{{$dayAccountInfo->RegPeple ?? 0}}
                                    </td>
                                    <td >
                                        {{ __('auto.活跃用户：') }}{{ $dayAccountInfo->ActivePeple ?? 0 }}

                                    </td>
                                    <td >
                                        {{ __('auto.充值用户：') }}{{ $dayAccountInfo->PayPeple ?? 0 }}
                                    </td>
                                    <td >
                                        {{ __('auto.累计充值：') }}{{ $dayAccountInfo->PayTotal / 100 ?? 0 }}<br>
                                    </td>
                                    <td>
                                        {{ __('auto.累计茶叶：') }}{{ $dayAccountInfo->DrawTotal / 100 ?? 0 }}<br>
                                    </td>
                                </tr>
                            </table>
                            <br>
                            <div style="width: 80%;float: left;">
                                <table class="table table-bordered" style="float: left;">

                                    <tr>
                                        <td>{{ __('auto.游戏房间') }}</td>
                                        <td>{{ __('auto.免费流水') }}</td>
                                        <td>{{ __('auto.免费返奖率') }}</td>
                                        <td>{{ __('auto.免费游戏人数') }}</td>
                                        <td style="background-color: #f5f5f5">付费{{ __('auto.流水') }}</td>
                                        <td style="background-color: #f5f5f5">付费{{ __('auto.返奖率') }}</td>
                                        <td style="background-color: #f5f5f5">付费{{ __('auto.返奖率') }}(历史)</td>
                                        <td style="background-color: #f5f5f5">付费{{ __('auto.游戏人数') }}</td>
                                    </tr>
                                    <tr>
                                        <td>{{ __('auto.总计') }}</td>
                                        <td>{{$games['gameRoomInfo']->free_flowing_water?? 0}}</td>
                                        <td>{{number_format((($games['gameRoomInfo']->free_flowing_water?? 0)-($games['gameRoomInfo']->free_win_lose ?? 0))/max(1,$games['gameRoomInfo']->free_flowing_water?? 0)*100,1)}}%</td>
                                        <td>{{$games['totalGameCount']-$games['pay_totalGameCount']}}</td>

                                        <td  style="background-color: #f5f5f5">{{$games['gameRoomInfo']->pay_flowing_water_new?? 0}}</td>
                                        <td  style="background-color: #f5f5f5">{{number_format((($games['gameRoomInfo']->pay_flowing_water_new?? 0)-($games['gameRoomInfo']->pay_win_lose ?? 0))/max(1,$games['gameRoomInfo']->pay_flowing_water_new?? 0)*100,1)}}%</td>
                                        <td style="background-color: #f5f5f5">{{$games['gameRoomInfo']->Rtp?? 0}}%</td>
                                        <td style="background-color: #f5f5f5">{{$games['pay_totalGameCount']}}</td>
                                    </tr>
                                    @foreach($games['gameList'] as $k=>$v)
                                        <tr>
                                            <td>{{$v->ServerName}}</td>

                                            <td>{{$v->free_flowing_water}}</td>
                                            <td>{{number_format(($v->free_flowing_water-$v->free_win_lose)/max(1,$v->free_flowing_water)*100,1)}}%</td>
                                            <td>{{$v->Cnt-$v->pay_Cnt}}</td>

                                            <td style="background-color: #f5f5f5">{{$v->pay_flowing_water_new}}</td>
                                            <td style="background-color: #f5f5f5">{{number_format(($v->pay_flowing_water_new-$v->pay_win_lose)/max(1,$v->pay_flowing_water_new)*100,1)}}%</td>
                                            <td style="background-color: #f5f5f5">{{$v->Rtp}}%</td>
                                            <td style="background-color: #f5f5f5">{{$v->pay_Cnt}}</td>
                                        </tr>
                                    @endforeach
                                </table>
                            </div>
                            <table class="table table-bordered" style="margin-left:25px;width: 18%;float: left">
                                <tr>
                                    <th colspan="2"> {{ __('auto.赠送彩金：') }}{{$winnings['winningsSum']}}</th>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.活动名称') }}</td>
                                    <td>{{ __('auto.金额') }}</td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.充值送金') }}</td>
                                    <td>{{$winnings['winnings']['45'] ?? 0}}</td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.注册送金') }}</td>
                                    <td>{{$winnings['winnings']['33'] ?? 0}}</td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.每日签到') }}</td>
                                    <td>{{ $winnings['winnings']['signIn'] ?? 0 }}</td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.绑定手机赠送') }}</td>
                                    <td>{{ $winnings['winnings']['21'] ?? 0 }}</td>
                                </tr>

                            </table>

                    </div>
                </div>
            </div>

        </div>
    </div>
@endsection
