Commit 8165a68f30d7677e4e4a392b3515281a9670debe

Authored by Matheus Nicoski
1 parent 1eecc992
Exists in 2.9 and in 7 other branches 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8

Adiciona campos da modal na query de update

ieducar/intranet/include/pmieducar/clsPmieducarCandidatoReservaVaga.inc.php
@@ -632,20 +632,25 @@ class clsPmieducarCandidatoReservaVaga extends Model @@ -632,20 +632,25 @@ class clsPmieducarCandidatoReservaVaga extends Model
632 * 632 *
633 * @throws Exception 633 * @throws Exception
634 */ 634 */
635 - public function alteraSituacao($situacao, $motivo = null) 635 + public function alteraSituacao($situacao, $motivo = null, $data = null)
636 { 636 {
637 if (!$this->cod_candidato_reserva_vaga) { 637 if (!$this->cod_candidato_reserva_vaga) {
638 return false; 638 return false;
639 } 639 }
640 640
641 $situacao = $situacao ?: 'NULL'; 641 $situacao = $situacao ?: 'NULL';
642 - $motivo = $motivo ?: 'NULL'; 642 + $motivo = $motivo ?: null;
  643 + if ($data) {
  644 + $data = "data_solicitacao = '{$data}',";
  645 + }
  646 +
643 $historico = $this->montaHistorico(); 647 $historico = $this->montaHistorico();
644 648
645 $db = new clsBanco(); 649 $db = new clsBanco();
646 $db->Consulta("UPDATE pmieducar.candidato_reserva_vaga 650 $db->Consulta("UPDATE pmieducar.candidato_reserva_vaga
647 SET situacao = {$situacao}, 651 SET situacao = {$situacao},
648 - motivo = {$motivo}, 652 + motivo = '{$motivo}',
  653 + {$data}
649 data_situacao = NOW(), 654 data_situacao = NOW(),
650 historico = '{$historico}' 655 historico = '{$historico}'
651 WHERE cod_candidato_reserva_vaga = '{$this->cod_candidato_reserva_vaga}'"); 656 WHERE cod_candidato_reserva_vaga = '{$this->cod_candidato_reserva_vaga}'");