Commit 000d3c23 authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

fix duplicacao de avaliacoes

parent 1abc2526
...@@ -465,20 +465,20 @@ class PadController extends Controller ...@@ -465,20 +465,20 @@ class PadController extends Controller
// //
//- - - Correção - - - //- - - Correção - - -
$tarefaIds = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->get()->map(function($model) { // $tarefaIds = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->get()->map(function($model) {
return $model->tarefa_id; // return $model->tarefa_id;
}); // });
foreach($tarefaIds as $tarefaId) // foreach($tarefaIds as $tarefaId)
{ // {
$avas = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->whereTarefaId($tarefaId)->get(); // $avas = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->whereTarefaId($tarefaId)->get();
if(count($avas) == 2) { // if(count($avas) == 2) {
$ava = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->whereTarefaId($tarefaId)->first(); // $ava = Avaliacao::whereType(AvaliacaoUtil::ENSINO_AULA)->whereTarefaId($tarefaId)->first();
$ava->type = 23; // $ava->type = 23;
$ava->save(); // $ava->save();
} // }
} // }
//- - - Correção - - - //- - - Correção - - -
} }
......
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