Browse Source

colocar uma condição para se for email, então procurar em todos usuário se já existe aquele email

1.9-pjsip
bruno 1 month ago
parent
commit
a5f11fe20b
  1. 2
      include/util/funcoesApl.php

2
include/util/funcoesApl.php

@ -3046,7 +3046,7 @@ function ExisteRegistro($db, $table, $where, $id, $queryParam = null) {
$join = "";
if ($table == 'pbx_usuarios') {
$join = "a INNER JOIN pbx_organizacao_usuarios b ON b.id_usuario = a.id ";
$compl = " 1=1 AND id_organizacao = $org_id AND ";
$compl = ($where == "email" ? " " : " id_organizacao = $org_id AND");
}
$query = "SELECT count(*) FROM $table $join WHERE $compl $where = '$id' ";

Loading…
Cancel
Save