@extends('layouts.admin')

@section('content')
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">充值记录</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
<div class="panel">
    <form action=''>
        @if (@$params['cp_notify_status']==5)
           <input type="hidden" class="btn btn-success" name='from_type' value='cutoff'/>
        @endif
        
        <input type="hidden" class="btn btn-success" name='from_device' value='{{ @$from_device }}'/>

        <div class="form-group">
            <label>渠道名称</label>
            <input class="form-control" name="cm" value="{{ @$params['cm'] }}">
        </div>
       
        <div class="form-group">
            <label>open_id</label>
            <input class="form-control" name="open_id" value="{{ @$params['open_id'] }}">
        </div>
        <div class="form-group">
            <label>支付交易号</label>
            <input class="form-control" name="out_trade_no" value="{{ @$params['out_trade_no'] }}">
        </div>

        <div class="form-group">
            <label>是否支付成功</label>
            <input  type='radio' name="is_pay" value= '100' {{ !isset($params['is_pay']) || @$params['is_pay']==100 ? 'checked' : '' }}>全部
            <input  type='radio' name="is_pay" value= '1' {{ @$params['is_pay']==1 ? 'checked' : '' }}>是
            <input  type='radio' name="is_pay" value= '0' {{ isset($params['is_pay']) && $params['is_pay']=='0' ? 'checked' : '' }}>否
        </div>

        <div class="form-group">
            <label>选择时间：</label>
            <input  name="start" onClick="WdatePicker()" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="{{ @$params['start'] }}"> -
            <input name="end" onClick="WdatePicker()" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="{{ @$params['end'] }}">
        </div>

        <button type="submit" class="btn btn-success">查询</button>
       <!--  <button type="button" class="btn btn-success" onclick="order_export()">导出</button> -->
                        
    </form>
</div>
<div class="alert alert-success">

</div>

<div class="panel panel-default">
    
    <div class="panel-heading">
        列表
    </div>
    <!-- /.panel-heading -->
    <div class="panel-body">
         <div class="dataTable_wrapper">
 
             <table class="table table-striped table-bordered table-hover" id="dataTables-example" style="text-align: center">
                <tr>
                    <th>ID</th>
                    <th>用户</th>
                    <th>邀请人</th>
                    <th>渠道名称<br></th>
                    <th>open_id<br>交易号<br>销售类型</th>
                    <th>课程分类<br>年龄段</th>
                    <th>是否支付<br>订单金额(元)<br>价格标签</th>
                    <th>下单时间<br>支付时间</th>
                </tr>
                @foreach ($records as $record)
                <tr >
                    <td>{{ $record->id }}</td>
                    <td style='text-align:center;'><img src='{{ $record->headimgurl }}' style='width:40px;height:40px;margin:0 auto;'>
                    <br>{{ $record->nick_name }}</td>
                    <td style='text-align:center;'>
                    @if (@$record->inventory_nick_name)
                       <img src='{{ $record->inventory_headimgurl }}' style='width:40px;height:40px;margin:0 auto;'>
                       <br>{{ $record->inventory_nick_name }}
                    @else
                    @endif
                    
                    </td>
                    <td>
                    <span style="color:blue;font-weight:bold;">{{ $record->channel_name }}</span>
                    </td>
                       <td>{{ $record->open_id }}<br>{{ $record->out_trade_no }}<br>
                     @if (@$record->sale_type=='presale')
                       预售
                    @elseif (@$record->sale_type=='nomal')
                      正式
                    @endif
                    </td>
                    <td>
                    @if (@$record->group_type=='single')
                       单人课程
                    @elseif (@$record->group_type=='spouse')
                      夫妻共读
                    @elseif (@$record->group_type=='ladybro')
                      闺蜜共读
                    @else
                       {{@$record->group_type}}
                    @endif
                    
                    <br>
                    @if (@$record->age_range=='0_3')
                       0~3岁
                    @elseif (@$record->age_range=='4_6')
                      4~6岁
                    @elseif (@$record->age_range=='7_12')
                      7~12岁
                    @else
                    @endif
                    
                    </td>
                    <td>
                    @if ($record->is_pay)  <span style="color:red;font-weight:bold;">是</span> @else 否 @endif
                    
                    <br>{{ round($record->total_fee/100,2) }}
                     <br>
                     @if (@$record->price_tag=='low')
                       低价格
                    @elseif (@$record->price_tag=='high')
                      高价格
                    @elseif (@$record->price_tag=='nomal')
                      低价格
                    @endif
                    </td>
                    <td>{{ $record->created_at }}<br>{{ $record->actual_pay_time }}</td>
                </tr>
                @endforeach
            </table>

        </div>
        
        <div class="paging">
            总计：{{ $records->total() }}
            {!! $records->appends($params)->links() !!}
         </div>
    </div>
</div>
<!-- Modal -->


<script type="text/javascript" src="{{ asset('js/My97DatePicker/WdatePicker.js') }}"></script>
<script>


</script>
@endsection
