@extends('base.base')
@section('base')

    <!-- 内容区域 -->
    <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" style=";margin:10px 0;padding:0">
                    <div class="card">
                        <div class="card-body">

                            <table class="table table-bordered">

                                <tr>
                                    <th><a href="/admin/withdrawal/waitWithdrawal">{{ __('auto.待处理茶叶') }}</a>
                                    </th>

                                    <th>{{ __('auto.申请：') }}
                                        {{$applyUserCount->userCount ?? 0}} {{ __('auto.人') }} {{$applyUserCount->count ?? 0}}
                                        {{ __('auto.笔') }}&nbsp;&nbsp;{{ __('auto.总计：') }}{{$applyUserCount->WithDraw ?? 0}} &nbsp;&nbsp;
                                    </th>


                                    <th><a href="/admin/complaint/opinion"> 24{{ __('auto.小时内客服') }}</a>
                                    </th>


                                    <th>{{ __('auto.未回复总计：') }}{{$message->count}}{{ __('auto.条') }} {{ __('auto.已回复：') }}{{$message->replycount}}{{ __('auto.条') }}
                                        {{ __('auto.已读：') }}{{$message->readcount}}{{ __('auto.条') }}
                                    </th>

                                </tr>


                            </table>


                            <table class="table table-bordered">
                                <tbody>
                                @foreach($alldata['plays'] as $item)
                                    <tr>
                                        <td><a href="{{$item['url']}}" target="_blank">{{$item['name']}}</a></td>
                                        <td><?php echo $item['package'] ?></td>
                                        <td>
                                            @if($item['status']==200)
                                                <span class="text-success">{{ __('auto.运行中') }}</span>

                                            @else
                                                <span class="text-danger">{{ __('auto.下架') }}</span>


                                            @endif


                                        </td>
                                        <td>
                                            @if(isset($item['downtime']))
                                                ({{ __('auto.下架时间') }}:<?php echo date("m-d H:i",$item['downtime'])?>)
                                            @elseif(isset($item['uptime']))
                                                ({{ __('auto.上架时间') }}:<?php echo date("m-d H:i",$item['uptime'])?>)
                                            @endif

                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>

                            <table class="table table-bordered">
                                <tbody>
                                @foreach($dataGropSums as $channel=>$item)
                                    @if (isset($alldata[$channel])&&$data=$alldata[$channel])
                                    <tr>
                                        <td width="20%"><span class="card-title">{{$Channels[$channel]}}({{$channel}})</span></td>
                                        <td width="12%">{{ __('auto.新增：') }}&nbsp;{{$data['today_register']}}<span style="font-size:0.7em;color:<?php echo intval($data['new_rhb'])>=0?"green":"red" ?>">({{$data['new_rhb']}})</span></td>
                                        <td width="10%">d0：&nbsp;{{$data['d0_day_pay_count']}}<span style="font-size:0.7em;color:<?php echo intval($data['d0_day_pay_rhb'])>=0?"green":"red" ?>">({{$data['d0_day_pay_rhb']}})</span></td>
                                        <td width="21%">{{ __('auto.充值：') }}&nbsp;{{$data['today_pay_sum']}}<span style="font-size:0.7em;color:<?php echo intval($data['pay_sum_rhb'])>=0?"green":"red" ?>">({{$data['pay_sum_rhb']}})</span>(U:{{$data['today_pay_sum_u']}})</td>
                                        <td width="22%">{{ __('auto.付费人数/新增：') }}&nbsp;{{$data['today_pay_count']}}/{{$data['day_pay_count']}}</td>
                                        <td width="15%">{{ __('auto.日活：') }}&nbsp;{{$data['today_live']}}</td>
                                    </tr>

                                    @endif
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                @foreach($adminChannels as $channel)
                    @if (isset($alldata[$channel])&&$data=$alldata[$channel])

                        <div class="col-lg-12 grid-margin stretch-card" id="short_{{$channel}}"
                             style="display: block;margin:0;padding:0" onclick="openBoard({{$channel}})">
                            <div class="card" style=";margin:0;padding:0">
                                <div class="card-body" style=";margin:0;padding:0 10px">

                                    <table
                                           class="table table-bordered">
                                        <tr>
                                        <td width="20%"><span class="card-title">({{$channel}}){{$Channels[$channel]??$channel}}</span></td>
                                        <td width="12%">{{ __('auto.新增：') }}&nbsp;{{$data['today_register']}}<span style="font-size:0.7em;color:<?php echo intval($data['new_rhb'])>=0?"green":"red" ?>">({{$data['new_rhb']}})</span></td>
                                        <td width="10%">d0：&nbsp;{{$data['d0_day_pay_count']}}<span style="font-size:0.7em;color:<?php echo intval($data['d0_day_pay_rhb'])>=0?"green":"red" ?>">({{$data['d0_day_pay_rhb']}})</span></td>
                                        <td width="21%">{{ __('auto.充值：') }}&nbsp;{{$data['today_pay_sum']}}<span style="font-size:0.7em;color:<?php echo intval($data['pay_sum_rhb'])>=0?"green":"red" ?>">({{$data['pay_sum_rhb']}})</span></td>
                                        <td width="22%">{{ __('auto.付费人数/新增：') }}&nbsp;{{$data['today_pay_count']}}/{{$data['day_pay_count']}}</td>
                                        <td width="15%">{{ __('auto.日活：') }}&nbsp;{{$data['today_live']}}</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-12 grid-margin stretch-card" id="expend_{{$channel}}"
                             style="display: none;margin:10px 0;padding:0" onclick="closeBoard({{$channel}})">
                            <div class="card">
                                <div class="card-body">
                                    <h4 class="card-title">({{$channel}}){{$Channels[$channel]??$channel}}</h4>
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th width="23%">{{ __('auto.新增用户') }}</th>
                                            <th width="23%">{{ __('auto.参游比') }}</th>
                                            <th width="18%">{{ __('auto.日活跃用户') }}</th>
                                            <th width="18%">{{ __('auto.周活跃用户') }}</th>
                                            <th width="18%">{{ __('auto.月活跃用户') }}</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td style="height: 120px;width:23% ">
                                                <div style="padding-bottom: 15%;">
                                                    <div style="width: 33%;float:left;">{{ __('auto.今日新增') }}</div>
                                                    <div style="width: 33%;float:left;">{{ __('auto.即时日环比') }}</div>
                                                    <div style="width: 34%;float:left;">{{ __('auto.昨日总新增') }}</div>
                                                </div>
                                                <div style="padding-bottom: 3%;">
                                                    <div style="width: 33%;float:left;">{{$data['today_register']}}</div>
                                                    <div style="width: 33%;float:left;">{{$data['new_rhb']}}</div>
                                                    <div style="width: 33%;float:left;">{{$data['yesterday_register']}}</div>
                                                </div>
                                            </td>
                                            <td style="height: 120px;width:23% ">
                                                <div style="padding-bottom: 15%;">
                                                    <div style="width: 33%;float:left;">{{ __('auto.今日参游') }}</div>
                                                    <div style="width: 33%;float:left;">{{ __('auto.日对比') }}</div>
                                                    <div style="width: 34%;float:left;">{{ __('auto.昨日参游') }}</div>
                                                </div>
                                                <div style="padding-bottom: 3%;">
                                                    <div style="width: 33%;float:left;">{{$data['today_play_rate']}}%</div>
                                                    <div style="width: 33%;float:left;">{{$data['play_rhb']}}</div>
                                                    <div style="width: 33%;float:left;">{{$data['yesterday_play_rate']}}%</div>
                                                </div>
                                            </td>
                                            <td style="height: 120px;">
                                                <div style="padding-bottom: 15%;">
                                                    <div style="width: 50%;float:left;">{{ __('auto.本日') }}</div>
                                                    <div style="width: 50%;float:left;">{{ __('auto.日环比') }}</div>
                                                </div>
                                                <div style="padding-bottom: 3%">
                                                    <div style="width: 50%;float:left;">{{$data['today_live']}}</div>
                                                    <div style="width: 50%;float:left;">{{$data['live_rhb']}}</div>
                                                </div>
                                            </td>
                                            <td style="height: 120px;">
                                                <div style="padding-bottom: 15%;">
                                                    <div style="width: 50%;float:left;">{{ __('auto.本周') }}</div>
                                                    <div style="width: 50%;float:left;">{{ __('auto.周环比') }}</div>
                                                </div>
                                                <div style="padding-bottom: 3%">
                                                    <div style="width: 50%;float:left;">{{$data['week_login']}}</div>
                                                    <div style="width: 50%;float:left;">{{$data['week_rhb']}}</div>
                                                </div>
                                            </td>
                                            <td style="height: 120px;">
                                                <div style="padding-bottom: 15%;">
                                                    <div style="width: 50%;float:left;">{{ __('auto.本月') }}</div>
                                                    <div style="width: 50%;float:left;">{{ __('auto.月环比') }}</div>
                                                </div>
                                                <div style="padding-bottom: 3%">
                                                    <div style="width: 50%;float:left;">{{$data['month_login']}}</div>
                                                    <div style="width: 50%;float:left;">{{$data['month_rhb']}}</div>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <table>
                                        <div align="center" style=" padding: 10px;">{{ __('auto.总注册用户：') }}{{$data['user_count']}}，{{ __('auto.休眠用户：') }}{{$data['dormancy_user']}}</div>
                                    </table>
                                    @if (hidden() != 'service')
                                        <table class="table table-bordered">
                                            <thead>
                                            <tr>
                                                <th width="22%">{{ __('auto.充值金额') }}</th>
                                                <th width="21%">{{ __('auto.付费人数') }}</th>
                                                <th width="21%">d0{{ __('auto.付费人数') }}</th>
                                                <th width="21%">{{ __('auto.新增付费人数') }}</th>
                                                <th width="15%">ltv</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td style="height: 120px;width: ">
                                                    <div style="padding-bottom: 15%;">
                                                        <div style="width: 33%;float:left;">{{ __('auto.今日充值') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.即时环比') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.昨日总额') }}</div>
                                                    </div>
                                                    <div style="padding-bottom: 3%;">
                                                        <div style="width: 33%;float:left;">{{$data['today_pay_sum']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['pay_sum_rhb']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['yesterday_pay_sum']}}</div>
                                                    </div>
                                                </td>
                                                <td style="height: 120px;">
                                                    <div style="padding-bottom: 15%;">
                                                        <div style="width: 33%;float:left;">{{ __('auto.本日') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.即时环比') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.昨日总数') }}</div>
                                                    </div>
                                                    <div style="padding-bottom: 3%">
                                                        <div style="width: 33%;float:left;">{{$data['today_pay_count']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['pay_count_rhb']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['yesterday_pay_count']}}</div>
                                                    </div>
                                                </td>
                                                <td style="height: 120px;">
                                                    <div style="padding-bottom: 20%;">
                                                        <div style="width: 33%;float:left;">d0</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.即时环比') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.昨日') }}d0</div>
                                                    </div>
                                                    <div style="padding-bottom: 3%">
                                                        <div style="width: 33%;float:left;">{{$data['d0_day_pay_count']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['d0_day_pay_rhb']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['d0_yday_pay_count']}}</div>
                                                    </div>
                                                </td>
                                                <td style="height: 120px;">
                                                    <div style="padding-bottom: 15%;">
                                                        <div style="width: 33%;float:left;">{{ __('auto.本日') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.即时环比') }}</div>
                                                        <div style="width: 33%;float:left;">{{ __('auto.昨日总新') }}</div>
                                                    </div>
                                                    <div style="padding-bottom: 3%">
                                                        <div style="width: 33%;float:left;">{{$data['day_pay_count']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['day_pay_rhb']}}</div>
                                                        <div style="width: 33%;float:left;">{{$data['yday_pay_count']}}</div>
                                                    </div>
                                                </td>

                                                <td style="height: 120px;">
                                                    <div style="padding-bottom: 20%;">
                                                        <div style="width: 50%;float:left;">d0_ltv</div>
                                                        <div style="width: 50%;float:left;">{{ __('auto.昨日') }}ltv</div>
                                                    </div>
                                                    <div style="padding-bottom: 3%">

                                                        <div style="width: 50%;float:left;">{{$data['d0_day_pay']['ltv_now']}}</div>
                                                        <div style="width: 50%;float:left;">{{$data['yes_day_pay']['ltv_now']}}</div>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                        <table>
                                            <div align="center">
                                                <a style="width: 20%" href="/admin/recharge/rank?start_time={{$alldata['time']}}&end_time={{$alldata['time']}}&Channel={{$channel}}" class="btn btn-sm btn-gradient-info btn-icon-text">{{ __('auto.今日充值排行榜') }}</a>
                                                <a style="width: 20%" href="/admin/recharge/list?&Channel={{$channel}}" class="btn btn-sm btn-gradient-info btn-icon-text">{{ __('auto.各档位充值明细') }}</a>
                                            </div>

                                        </table>
                                    @endif

                                </div>
                            </div>
                        </div>
                    @endif
                @endforeach


            </div>
        </div>
    </div>
    <script>
        function openBoard(channel){
            $('#expend_'+channel).show();
            $('#short_'+channel).hide();
        }

        function closeBoard(channel){
            $('#expend_'+channel).hide();
            $('#short_'+channel).show();
        }
        $(function(){
            cutStr(50);
        });
        // function update(id){
        //     myConfirm("是否继续?",function(){
        //         var nullity= document.getElementById('nullity').value;
        //         myRequest("/admin/user/freeze/"+id,"post",{nullity:nullity},function(res){
        //             layer.msg(res.msg)
        //             setTimeout(function(){
        //                 window.location.reload();
        //             },1500)
        //         });
        //     });
        // }
            setInterval(function (){
            window.location.reload();
        },300000)

    </script>
@endsection
