我正在更改Laravel项目模板,我完全做到了。
我有一些页面,它们使用JavaScript来上传数据库数据。 但是更改之后,它们将不起作用,并且我的表显示为空。
我的新模板是AdminLTE v3 页面代码示例:
@extends('layouts.app')
@section('title', getOption('app_name') . ' - My Orders')
@section('content')
@php
$status = $status ?? false;
$dataURL = $status ? "/orders-filter-ajax/$status/data" : "/orders-index/data";
@endphp
<div class="row pull-right">
<div class="col-md-12 " style="margin-bottom: 5px">
<div class="btn-group" style="text-align:right">
<b>
<a href="{{ url('/orders/') }}" class="btn btn-primary btn btn-primary {{ $status == false ? 'active' : '' }}" >All</a>
<a href="{{ url('/orders-filter/pending') }}" class="btn btn-primary {{ $status == 'pending' ? 'active' : '' }}">Pending</a>
<a href="{{ url('/orders-filter/inprogress') }}" class="btn btn-primary {{ $status == 'inprogress' ? 'active' : '' }}">Inprogress</a>
<a href="{{ url('/orders-filter/completed') }}" class="btn btn-primary {{ $status == 'completed' ? 'active' : '' }}">completed</a>
<a href="{{ url('/orders-filter/partial') }}" class="btn btn-primary {{ $status == 'partial' ? 'active' : '' }}">Partial</a>
<a href="{{ url('/orders-filter/cancelled') }}" class="btn btn-primary {{ $status == 'cancelled' ? 'active' : '' }} ">cancelled</a>
</b>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive">
<table class="table table-bordered table-hover"style="width: 99.9%; text-align:center" id="table">
<thead>
<tr>
<th style="text-align:center">@lang('general.order_id')</th>
<th style="text-align:center">@lang('general.service')</th>
<th style="text-align:center">@lang('general.package')</th>
<th style="text-align:center">@lang('general.link')</th>
<th style="text-align:center">Price</th>
<th style="text-align:center">@lang('general.quantity')</th>
<th style="text-align:center">@lang('general.start_counter')</th>
<th style="text-align:center">@lang('general.remains')</th>
<th style="text-align:center">@lang('general.date')</th>
<th style="text-align:center">@lang('general.status')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
$(function () {
$('#table').DataTable({
processing: true,
serverSide: true,
pageLength: 25,
order: [ [0, 'desc'] ],
ajax: '{!! url($dataURL) !!}',
columns: [
{data: 'id', name: 'id'},
{data: 'package.service.name', name: 'package.service.name'},
{data: 'package.name', name: 'package.name'},
{data: 'link', name: 'link', sortable:false},
{data: 'price', name: 'amount', sortable:false, searchable:false},
{data: 'quantity', name: 'quantity', sortable:false, searchable:false},
{data: 'start_counter', name: 'start_counter', sortable:false, searchable:false},
{data: 'remains', name: 'remains', sortable:false, searchable:false},
{data: 'created_at', name: 'created_at'},
{data: 'status', name: 'status'}
]
});
})
</script>
@endpush
该如何解决? 引导程序版本吗?