This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ProcedimentoOcupacaoController extends Controller
|
||||
{
|
||||
public function index($ocupacaoId)
|
||||
{
|
||||
|
||||
$competencias = DB::table('sigtap.competencia')
|
||||
->select('id')
|
||||
->orderByDesc('valor')
|
||||
->take(4)
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
$procedimentoOcupacao = DB::table('sigtap.procedimento_ocupacao')
|
||||
->whereIn('competencia_id', $competencias)
|
||||
->where('ocupacao_id', $ocupacaoId)
|
||||
->get()
|
||||
->pluck('procedimento_id');
|
||||
|
||||
return response()->json($procedimentoOcupacao, Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user