@extends('admin.layout')

@section('content')
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>交易列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form method="GET" action="" accept-charset="UTF-8">

                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" value="{{Request::get('keyword')}}" placeholder="ID/订单号"
                                           name="keyword" class="input-sm form-control">
                                    <span class="input-group-btn">
									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
								</span>
                                </div>
                            </div>
                        </form>
                    </div>

                    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                        <thead>
                        <tr>

                            <th class="sorting" data-sort="id"> ID</th>
                            <th class="sorting" data-sort="user_id"> 来源用户</th>
                            <th class="sorting" data-sort="user_id"> 去向用户</th>
                            <th class="sorting" data-sort="openid"> 用户openid</th>
                            <th class="sorting" data-sort="out_trade_no"> 支付订单号</th>
                            <th class="sorting" data-sort="price"> 支付金额</th>
                            <th class="sorting" data-sort="type"> 支付类型</th>
                            <th class="sorting" data-sort="created_at"> 创建时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        @if(isset($list))
                            @foreach($list as $key => $item)
                                <tr>

                                    <td>{{ $item->id }}</td>
                                    <td>{{ $item->user }}</td>
                                    <td>{{ $item->to_user_name }}</td>
                                    <td>{{ $item->openid }}</td>
                                    <td>{{ $item->out_trade_no }}</td>
                                    <td>{{ $item->price }}</td>
                                    <td>{{ $item->payment }}</td>
                                    <td>{{ $item->created_at }}</td>

                                </tr>
                            @endforeach
                        @endif

                        </tbody>
                    </table>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="dataTables_info" id="DataTables_Table_0_info"
                                 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
                                条，共{{ $list->lastPage() }}页，总{{ $list->total() }}条。
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                {!! $list->setPath('')->appends(Request::all())->render() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection