This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\ExameImagem;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\ExameImagem\RelatorioProducaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioProducaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'exame-imagem';
|
||||
protected $funcionalidade = 'relatorio-producao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioProducaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioProducaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
return response()->json(RelatorioProducaoService::datatable($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function autocompleteProcedimento()
|
||||
{
|
||||
return
|
||||
datatables()
|
||||
->of(RelatorioProducaoService::autocompleteProcedimento())
|
||||
->filterColumn('codigo', function ($query, $keyword) {
|
||||
|
||||
$query
|
||||
->whereRaw("sigtap.procedimento.codigo like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(sigtap.procedimento.codigo,1,2),
|
||||
'.',
|
||||
SUBSTR(sigtap.procedimento.codigo,3,2),
|
||||
'.',
|
||||
SUBSTR(sigtap.procedimento.codigo,5,2),
|
||||
'.',
|
||||
SUBSTR(sigtap.procedimento.codigo,7,3),
|
||||
'-',
|
||||
SUBSTR(sigtap.procedimento.codigo,10,1)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user