@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/bind_list'>
                                <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;

                                <spen style="padding-left: 10px" >{{ __('auto.会员ID：') }}</spen>
                                <input class="form-control" type="text" name="UserID" style="width: 10%; " value="{{$UserID}}" >
                                <spen style="padding-left: 10px" >{{ __('auto.上级ID：') }}</spen>
                                <input class="form-control" type="text" name="SpreaderID" style="width: 10%; " value="{{$SpreaderID}}" >
                                <span>{{ __('auto.排序') }}</span>
                                @component('components.select', [
                                'name' => 'sort', 'options' => [
                                    '' => '',
                                    'downCount1 + downCount2' =>  __('auto.按最多排序'),
                                ],
                                'default' => $request->input('sort')])
                                @endcomponent
                                <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                <a href="/admin/user/bind_list" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="5%">{{ __('auto.会员') }}ID</th>
                                    <th width="8%">TA{{ __('auto.的上级') }}ID</th>
                                    <th width="8%">{{ __('auto.已发放额度') }}</th>
                                    <th width="8%">{{ __('auto.账号创建时间') }}</th>
                                    <th width="8%">{{ __('auto.最后登录时间') }}</th>
                                    <th width="8%">{{ __('auto.所有下级人数') }}</th>
                                    <th width="8%">{{ __('auto.直属下级') }}</th>
                                    <th width="8%">{{ __('auto.下下级') }}</th>

                                </tr>
                                </thead>
                                <tbody>

                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>
                                            <a href="/admin/global/id_find?UserID={{$v->UserID}}">
                                                {{$v->GameID}}
                                            </a>
                                        </td>
                                        <td>{{ $v->SpreaderID }}</td>
                                        <td>{{ $v->Rewards }}</td>
                                        <td>{{$v->RegisterDate}}</td>
                                        <td>{{ $v->LastLogonDate }}</td>
                                        <td>{{$v->downCount1 + $v->downCount2}}</td>
                                        <td>
                                            @if ($v->downCount1 > 0)
                                                <a href="/admin/user/bind_list?Higher1ID={{$v->UserID}}">
                                                    {{$v->downCount1}}
                                                </a>
                                            @else
                                                {{$v->downCount1}}
                                            @endif

                                        </td>
                                        <td>
                                            @if ($v->downCount2 > 0)
                                                <a href="/admin/user/bind_list?Higher2ID={{$v->UserID}}">
                                                    {{$v->downCount2}}
                                                </a>
                                            @else
                                                {{$v->downCount2}}
                                            @endif

                                        </td>

                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">

                                {{ __('auto.总共') }} <b>{{ $list->appends($request->all())->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>

        function supplement(id){
            myConfirm("{{ __('auto.操作不可逆,是否继续') }}?",function(){
                myRequest("/admin/recharge/supplement/"+id,"post",{},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }


        $(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
