Commit f5e72f5c authored by sandroresende's avatar sandroresende

correcao funcao criar selecao

parent 1d33254f
......@@ -399,7 +399,7 @@ class SelecaoController extends Controller
public function SelecionarPropostas (){
$selecaoProposta = SelecaoPropostas::orderBy('dte_resultado')->get();
$selecaoProposta = SelecaoPropostas::orderBy('id')->get();
$numSelecaoAndamento = 0;
......@@ -434,6 +434,15 @@ class SelecaoController extends Controller
$usuario = Auth::user();
$selecaoProposta = SelecaoPropostas::where('bln_selecao_concluida',false)->get();
// return count($selecaoProposta);
if(count($selecaoProposta) > 0){
flash()->erro("Erro", "Já existe uma seleção em andamento. Favor concluir a seleção antes de iniciar uma nova seleção");
return back();
}
$selecaoProposta = new SelecaoPropostas;
$selecaoProposta->user_id = $usuario->id;
$selecaoProposta->num_propostas = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment