Problems with datatable when displaying data

0
function vistas_due_listasedes(Request $request)
      {
          $estable = $request->get('estable');
          $anio = $request->get('anio_corte');
          $mes = $request->get('mes_corte');
          $sedes = HistoricoSede::select(['codigo_sede','nombre_sede','direccion','telefono','nombre_departamento','nombre_municipio','estado_sede'])->where('codigo_establecimiento',$estable)->where("anio_corte",$anio)->where("mes_corte",$mes);
          return Datatables::of($sedes)->make(true);
      }

This is the function that shows the data.

  <script type="text/javascript">
  function activartablalistasedes(estable) {
    var anio_corte = $("input[name='anio_corte']:checked").val();
    var mes_corte = document.getElementById("mes_corte").value;
     $('#tablesedes').DataTable({
        destroy: true,
        processing: true,
        serverSide: true,
        pageLength: 5,
        language: {
                  "url": '{!! asset('/plugins/datatables/latino.json') !!}'
                   },
        ajax:{
           url : '{{ route('datatable.sedes') }}',
           type: "GET",
           data: {"estable": estable.value,"anio_corte":anio_corte,"mes_corte":mes_corte}
        },
        columns: [
          { data:  'codigo_sede',  render: function ( data, type, row )
           {
             return '<a onclick=" _mostrarsedes('+ data +')"  class="btn  btn-success btn-xs" data-toggle="tooltip" data-placement="top" title="Ver Información" >'+data+'</a>'
           }
         },
           { data: 'nombre_sede', name: 'nombre_sede' },
           { data: 'direccion', name: 'direccion' },
           { data: 'telefono', name: 'telefono' },
           { data: 'nombre_departamento', name: 'nombre_departamento' },
           { data: 'nombre_municipio', name: 'nombre_municipio' },
           { data: 'estado_sede', name: 'estado_sede' }

        ]

     });
  }
  </script>

This is how the table is structured in the database.

public function up()
{
    Schema::create('historico_sedes', function (Blueprint $table) {

      $table->increments('id');
      $table->tinyInteger   ('mes_corte')->nullable()->index();
      $table->year          ('anio_corte')->nullable()->index();
      $table->biginteger    ('codigo_departamento')->nullable();
      $table->string        ('nombre_departamento')->nullable();
      $table->biginteger    ('codigo_dane_municipio')->nullable();
      $table->string        ('nombre_municipio')->nullable();
      $table->biginteger    ('codigo_establecimiento')->nullable()->index();
      $table->string        ('nombre_establecimiento')->nullable();
      $table->biginteger    ('codigo_sede')->nullable()->index();
      $table->string        ('nombre_sede')->nullable();
      $table->string        ('zona')->nullable();
      $table->string        ('direccion')->nullable();
      $table->string        ('telefono')->nullable();
      $table->string    ('estado_sede')->nullable();
      $table->string    ('niveles')->nullable();
      $table->string    ('modelos',500)->nullable();
      $table->string    ('grados')->nullable();
      $table->timestamps();
    });
}

I'm trying to show the information, but sometimes when I bring the data list, it shows me this error.

And in console it shows me this error:

    
asked by Andrés Cantillo 27.06.2018 в 16:48
source

0 answers