@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>
                            <form class="well form-inline margin-top-20" method="get" action='/admin/user/spreader'>
                                {{ __('auto.推广员编号：') }}
                                <input class="form-control" type="text" name="game_id" style="width: 10%; " value="{{$game_id}}" placeholder="{{ __('auto.请输入推广员编号') }}">
                                <spen style="padding-left: 10px" >{{ __('auto.选择时间：') }}</spen>
                                <input type="date"  step="01" name="start_time" class="form-control" value="{{$start_time}}" />&nbsp;&nbsp;
                                <input type="date"  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/user/spreader" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                            </form>
                            <table class="table table-bordered">
                                <thead>
                                @if(empty($list))
                                @else
                                <div>
                                    <div style="padding-bottom: 3%;padding-top: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.推广员ID：') }}{{$list['game_id']}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.推广总用户数：') }}{{$list['children_count']}}</div>
                                        <div style="width: 40%;float:left;">{{ __('auto.计提收益：') }}{{$list['revenue']}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.推广员昵称：') }}{{$list['nick_name']}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.活跃用户：') }}{{$list['live_users']}}</div>
                                        <div style="width: 40%;float:left;">{{ __('auto.已提收益：') }}{{$list['gold']}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.推广员姓名：') }}{{$list['name']}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.流失用户：') }}{{$list['sleep_users']}}</div>
                                        <div style="width: 40%;float:left;">{{ __('auto.总收益：') }}{{$list['revenue_sum']}}</div>
                                    </div>
                                        <div style="width: 40%;float:left;">{{ __('auto.有效用户：') }}{{$list['eff_user']}}</div>
                                    
                                </div>
                                <div style="border-bottom:1px solid #000">
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="purchase({{$list['user_id']}})">{{ __('auto.每日推广数据') }}</button>
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="game({{$list['user_id']}})">{{ __('auto.下级推广数据') }}</button>
                                </div>
                                @endif
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function purchase(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.每日推广数据') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/spreader/everyday/'+id
            });
        }
        function game(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.下级推广数据') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/spreader/subordinate/'+id
            });
        }
        
    </script>
@endsection
