This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\ExameLaboratorial;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\ExameLaboratorial\JornadaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class JornadaController extends Controller
|
||||
{
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return response()->json(JornadaService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
return response()->json(JornadaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()->of(JornadaService::datatable())
|
||||
->filterColumn('nome_fantasia', function($query, $keyword) {
|
||||
$query->whereRaw(
|
||||
"CONCAT(
|
||||
cadastro_unidade.nome_fantasia,
|
||||
' - ',
|
||||
CASE WHEN cadastro_infraestrutura.nome IS NOT NULL THEN
|
||||
cadastro_infraestrutura.nome
|
||||
ELSE
|
||||
cadastro_unidade.nome_fantasia
|
||||
END
|
||||
) LIKE ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user