@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">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.用户分布') }}</h4>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="8%">{{ __('auto.操作系统') }}</th>
                                    <th width="8%">{{ __('auto.总用户数') }}</th>
                                    <th width="10%">{{ __('auto.活跃用户数') }}</th>
                                    <th width="10%">{{ __('auto.累计充值金额') }}</th>
                                    <th width="10%">{{ __('auto.充值用户数') }}</th>
                                    <th width="6%">{{ __('auto.充值率') }}</th>
                                    <th width="5%">ARPU</th>
                                    <th width="5%">ARPPU</th>
                                    <th width="10%">{{ __('auto.男女比例') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>{{ $v['type'] }}</td>
                                        <td>{{ $v['num'] }}</td>
                                        <td>{{ $v['lively_num'] }}</td>
                                        <td>{{ $v['recharge'] }}</td>
                                        <td>{{ $v['recharge_num'] }}</td>
                                        <td>{{ $v['recharge_ratio'] }}</td>
                                        <td>{{ $v['arpu'] }}</td>
                                        <td>{{ $v['arppu'] }}</td>
                                        <td>{{ $v['ratio'] }}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function(){
            cutStr(50);
        });
        function update(id){
            myConfirm("{{ __('auto.处理操作不可逆,是否继续') }}?",function(){
                myRequest("/admin/accusation/edit/"+id,"post",{},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
        function del(id){
            myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?",function(){
                myRequest("/admin/accusation/del/"+id,"post",{},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
        
    </script>
@endsection
