index.blade.php 4.32 KB
@extends ('backend.layouts.app')

@section ('title', trans('labels.backend.wxguide.management'))

@section('after-styles')
    {{ Html::style("https://cdn.datatables.net/v/bs/dt-1.10.15/datatables.min.css") }}
@endsection

@section('page-header')
    <h1>
        {{ trans('labels.backend.wxguide.management') }}
        <small>{{ trans('labels.backend.wxguide.active') }}</small>
    </h1>
@endsection

@section('content')
    <div class="box box-success">
        <div class="box-header with-border">
            <h3 class="box-title">{{ trans('labels.backend.wxguide.active') }}</h3>

            <div class="box-tools pull-right">
                @include('backend.wxguide.includes.partials.wxguide-header-buttons')
            </div><!--box-tools pull-right-->

        </div><!-- /.box-header -->

        <div class="box-body">
            <div class="table-responsive">
                <table id="users-table" class="table table-condensed table-hover">
                    <thead>
                    <tr>
                        {{--<th>{{ trans('labels.backend.wxguide.table.business_name') }}</th>--}}
                        <th>{{ trans('labels.backend.wxguide.table.spotname') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.nick_name') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.type') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.discount') }}</th>
                        {{--<th>{{ trans('labels.backend.wxguide.table.reason') }}</th>--}}
                        <th>{{ trans('labels.backend.wxguide.table.discount_money') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.bonus') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.expire_time') }}</th>
                        <th>{{ trans('labels.backend.wxguide.table.ctime') }}</th>
                        <th>{{ trans(trans('labels.general.actions')) }}</th>
                    </tr>
                    </thead>
                </table>
            </div><!--table-responsive-->
        </div><!-- /.box-body -->
    </div><!--box-->
@endsection

@section('after-scripts')
    {{ Html::script("https://cdn.datatables.net/v/bs/dt-1.10.15/datatables.min.js") }}
    {{ Html::script("js/backend/plugin/datatables/dataTables-extend.js") }}

    <script>
        $(function () {
            $('#users-table').DataTable({
                dom: 'lfrtip',
                processing: false,
                serverSide: true,
                autoWidth: false,
                ajax: {
                    url: '{{ route("admin.wxguide.get") }}',
                    type: 'get',
                    data: {status: 1, trashed: false},
                    error: function (xhr, err) {
                        if (err === 'parsererror')
                            location.reload();
                    }
                },
                columns: [
                    // {data: 'business_name', name: 'business_name'},
                    {data: 'spotname', name: 'spotname'},
                    {data: 'nick_name', name: 'nick_name'},
                    {data: 'type', name: 'type',render:function(data,type,row,meate){

                         if(data==1){
                             data = '折扣';
                         }else if(data==2){
                             data ='满减'
                         }
                         return data
                    }} ,
                    {data: 'discount', name: 'discount', render:function(data,type,row,meate){
                        return data * 0.01;
                    }},
                    // {data: 'reason', name: 'reason' },
                    {data: 'discount_money', name: 'discount_money', render:function(data,type,row,meate){
                            return data * 0.01;
                    }},
                    {data: 'bonus', name: 'bonus', render:function(data,type,row,meate){
                         return data * 0.01;
                        
                    } },
                    {data: 'expire_time', name: 'expire_time' },
                    {data: 'ctime', name: 'ctime'},
                    {data: 'actions', name: 'actions', searchable: false, sortable: false}
                ],
                order: [[0, "asc"]],
                searchDelay: 500
            });
        });


    </script>
@endsection