@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-account-check"></i>
                    </span>
                    Superball 用户任务
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">活动管理</a></li>
                        <li class="breadcrumb-item active" aria-current="page">Superball 用户任务</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">用户任务完成情况</h4>
                            <form class="well form-inline margin-top-20" method="get" action="/admin/superball/user-tasks">
                                <div>
                                    <span style="padding-left: 10px">任务日期：</span>
                                    <input type="date" name="date" class="form-control" value="{{ $date ?? '' }}" />
                                    <span style="padding-left: 10px">用户ID：</span>
                                    <input type="text" name="user_id" class="form-control" style="width: 100px;" value="{{ $userId ?: '' }}" placeholder="UserID" />
                                    <span style="padding-left: 10px">档位：</span>
                                    <select name="tier" class="form-control" style="width: 80px;">
                                        <option value="">全部</option>
                                        <option value="A" @if(($tier ?? '') == 'A') selected @endif>A</option>
                                        <option value="B" @if(($tier ?? '') == 'B') selected @endif>B</option>
                                        <option value="C" @if(($tier ?? '') == 'C') selected @endif>C</option>
                                        <option value="D" @if(($tier ?? '') == 'D') selected @endif>D</option>
                                        <option value="E" @if(($tier ?? '') == 'E') selected @endif>E</option>
                                    </select>
                                    <span style="padding-left: 10px">状态：</span>
                                    <select name="status" class="form-control" style="width: 100px;">
                                        <option value="" @if((string)($status ?? '') === '') selected @endif>全部</option>
                                        <option value="0" @if((string)($status ?? '') === '0') selected @endif>未领球</option>
                                        <option value="1" @if((string)($status ?? '') === '1') selected @endif>已领球</option>
                                    </select>
                                </div>
                                <div style="margin-top: 10px;">
                                    <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="查询"/>&nbsp;&nbsp;
                                    <a href="/admin/superball/user-tasks" class="btn btn-sm btn-gradient-warning btn-icon-text">清空</a>
                                </div>
                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>会员ID</th>
                                    <th>任务日期</th>
                                    <th>档位</th>
                                    <th>状态</th>
                                    <th>用户系数</th>
                                    <th>球号码及数量</th>
                                    <th>预计奖励(展示)</th>
                                    <th>更新时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $v)
                                    <tr>
                                        <td>{{ $v->id }}</td>
                                        <td>
                                            <a href="/admin/global/id_find?UserID={{ $v->user_id }}">
                                                {{ $v->game_id ?? $v->user_id }}
                                            </a>
                                        </td>
                                        <td>{{ $v->task_date }}</td>
                                        <td>{{ $v->tier }}</td>
                                        <td>{{ $v->status == 1 ? '已领球' : '未领球' }}</td>
                                        <td>{{ $v->user_multiplier ?? 1 }}</td>
                                        <td>{{ $v->ball_numbers_text !== '' ? $v->ball_numbers_text . '（' . $v->ball_count_actual . '个）' : '-' }}</td>
                                        <td>{{ $v->estimated_reward_display ?? '0.00' }}</td>
                                        <td>{{ $v->updated_at }}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                共 <b>{{ $list->total() }}</b> 条，共 <b>{{ $list->lastPage() }}</b> 页
                                {!! $list->appends(['date' => $date, 'user_id' => $userId, 'tier' => $tier, 'status' => $status])->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
