@extends('vip.layouts')
@section('content')
<style>
    .layui-laydate-range {
        width: auto;
    }

    .layui-form-switch em {
        width: auto;
    }

    .layui-form-switch {
        width: 44px;
        line-height: 23px;
    }

    .layui-form-item .checkbox {
        width: auto;
    }

    .statistics{
        margin: 0 auto;
        text-align: center;
        margin-bottom: 5px;
    }

    .money_color{
        color:red;
    }

    .money_green{
        color: green;
    }
</style>
<script type="text/html" id="count">
    <span class="money_color">@{{ d.count }}</span>
</script>
<script type="text/html" id="in">
    <span class="money_color">
        @{{#if(d.in>0){ }}
            -@{{ d.in }}
        @{{#}else{ }}
            @{{ d.in }}
        @{{#} }}
    </span>
</script>
<script type="text/html" id="out">
    <span class="money_green">
        @{{#if(d.out>0){ }}
            +@{{ d.out }}
        @{{#}else{ }}
            @{{ d.out }}
        @{{#} }}
    </span>
</script>
<!---注单管理-->
<div class="layui-row">
    <div class="layui-col-sm12 layui-col-md12 text" >
        <form class="layui-form rewrite" eventType=eventForm>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">平台类型</label>
                    <div class="layui-input-inline" style="width: 200px">
                        <select name="game_type"  id="form_gametype"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
                            <option value="all" @if($game_type=='all') selected @endif  eventType=event-query>所有平台</option>
                            @if(isset($gameList)&& is_array($gameList))
                                @foreach($gameList as $k=>$v):
                                    <option value="{{$v['game_type']}}" @if($game_type==$v['game_type']) selected @endif  eventType=event-query>{{$v['game_zh']}}</option>
                                @endforeach
                            @endif
                            <!--<option value="oggame" @if($game_type=='oggame') selected @endif  eventType=event-query>OG视讯</option>
                            <option value="kygame" @if($game_type=='kygame') selected @endif  eventType=event-query>开元棋牌</option>
                            <option value="aggame" @if($game_type=='aggame') selected @endif  eventType=event-query>AG视讯</option>
                            <option value="lcqpgame" @if($game_type=='lcqpgame') selected @endif  eventType=event-query>龙城棋牌</option>
                            <option value="Hjgame" @if($game_type=='Hjgame') selected @endif  eventType=event-query>皇家视讯</option>-->
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">时间</label>
                    <div class="layui-input-inline">
                        <input type="text" name="start_time" id="sub_time" placeholder=" - " lay-verify=""
                               autocomplete="off" class="layui-input test-item" eventType=event-query
                               value="{{ $start_time }}">
                    </div>
                </div>~
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <input type="text" name="end_time" id="sub_time" placeholder=" - " lay-verify=""
                               autocomplete="off" class="layui-input test-item" eventType=event-query
                               value="{{ $end_time }}">
                    </div>
                </div>
                <div class="layui-inline">
                    <a class="layui-btn layui-btn-sm lay-btn-diy" data-type="reload"  eventType=event-query-submit
                       style="opacity: 1; pointer-events: auto;">提交</a>
                    <a class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload"
                       style="opacity: 1; pointer-events: auto;">重置</a>
                    <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload"
                       style="opacity: 1; pointer-events: auto;" href="javascript:window.location.reload()">
                        <i class="layui-icon">ဂ</i>
                    </a>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <input type="text" name="localuser" id="localuser" placeholder="请输入会员名" lay-verify="" autocomplete="off" eventType=event-query
                               class="layui-input" value="">
                    </div>
                    <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload"
                       style="opacity: 1; pointer-events: auto;" id="searchq">查询会员游戏余额
                    </a>
                </div>

            </div>
        </form>
    </div>
</div>
@push('dataTableJS')
    $('.layui-table-page').after('<div class="statistics">'+
        '<p>当前成功从余额转出到游戏：<span class="green">{{ $in_money }}</span>，当前成功从游戏转入到余额：<span class="green">{{ $out_money }}</span> </p>'+
        '<p>当前总盈利金额：<span class="green">{{ $ap_money }}</span>。（如果为正数，表示赢钱，如果为负数，则为输钱）</p>'+
    '</div>');
@endpush
@include('vip.datatable')
<script>
    $('#searchq').on('click', function(){

        let localuser = $('#localuser').val();

        if(localuser == '' || localuser == null)
        {
            layer.tips('请输入会员名','#localuser',{
                tips: 3
            });
        }
        else
        {
            layer.open({
                type: 2,
                title: '查询会员游戏余额',
                shadeClose: true,
                shade: 0.8,
                area: ['30%', '70%'],
                content: '/admin/Rgame/userBalance?localuser='+ localuser +''
            });
        }
    });
</script>
@endsection