Commit b0a150a5bfe1246e042291653dd9b88d00200d3d
1 parent
0eb29e16
Exists in
master
and in
1 other branch
Ajustes feitos no serviço de consulta de contatos
Showing
2 changed files
with
22 additions
and
7 deletions
Show diff stats
controlador_ws.php
| ... | ... | @@ -939,7 +939,7 @@ $app->group('/api/v1',function(){ |
| 939 | 939 | //Assunto explode lista de objetos |
| 940 | 940 | $assuntos = array(); |
| 941 | 941 | if($request->getParam('assuntos')){ |
| 942 | - $assuntos = $request->getParam('assuntos'); | |
| 942 | + $assuntos = json_decode($request->getParam('assuntos'), TRUE); | |
| 943 | 943 | } |
| 944 | 944 | //Interessado explode lista de objetos |
| 945 | 945 | $interessados = array(); | ... | ... |
rn/MdWsSeiContatoRN.php
| ... | ... | @@ -23,23 +23,33 @@ class MdWsSeiContatoRN extends InfraRN |
| 23 | 23 | $filter = $objGetMdWsSeiContatoDTO->getStrFilter(); |
| 24 | 24 | $start = $objGetMdWsSeiContatoDTO->getNumStart(); |
| 25 | 25 | $limit = $objGetMdWsSeiContatoDTO->getNumLimit(); |
| 26 | + $bool = false; | |
| 26 | 27 | |
| 27 | 28 | $contatoDTO = new ContatoDTO(); |
| 28 | 29 | |
| 29 | 30 | if($id) |
| 30 | 31 | $contatoDTO->setNumIdContato($id); |
| 31 | 32 | |
| 32 | - if($filter) | |
| 33 | - $contatoDTO->setStrNome('%'.utf8_decode($filter).'%',InfraDTO::$OPER_LIKE); | |
| 33 | + if($filter) { | |
| 34 | + $contatoDTO->adicionarCriterio(array('Nome', 'Nome'), | |
| 35 | + array(InfraDTO::$OPER_LIKE, InfraDTO::$OPER_LIKE), | |
| 36 | + array('%' . utf8_decode(str_replace("-"," ", $filter)) . '%', '%' . utf8_decode(str_replace(" ","-", $filter)) . '%'), | |
| 37 | + array(InfraDTO::$OPER_LOGICO_OR)); | |
| 38 | + } | |
| 39 | + | |
| 34 | 40 | |
| 35 | 41 | $contatoCountDTO = new ContatoDTO(); |
| 36 | 42 | $contatoCountDTO->retNumIdContato(); |
| 37 | 43 | |
| 38 | - IF($limit) | |
| 44 | + IF($limit) { | |
| 39 | 45 | $contatoDTO->setNumMaxRegistrosRetorno($limit); |
| 46 | + $bool = true; | |
| 47 | + } | |
| 40 | 48 | |
| 41 | - IF($start) | |
| 42 | - $contatoDTO->setNumPaginaAtual($start); | |
| 49 | + IF($start) { | |
| 50 | + $contatoDTO->setNumPaginaAtual($start); | |
| 51 | + $bool = true; | |
| 52 | + } | |
| 43 | 53 | |
| 44 | 54 | $contatoDTO->retNumIdContato(); |
| 45 | 55 | $contatoDTO->retStrSigla(); |
| ... | ... | @@ -62,7 +72,12 @@ class MdWsSeiContatoRN extends InfraRN |
| 62 | 72 | } |
| 63 | 73 | |
| 64 | 74 | $total = 0; |
| 65 | - $total = count($contatoCountDTO); | |
| 75 | + $total = count($arrayRetorno); | |
| 76 | + | |
| 77 | + if($bool){ | |
| 78 | + $total = count($contatoCountDTO); | |
| 79 | + } | |
| 80 | + | |
| 66 | 81 | |
| 67 | 82 | return MdWsSeiRest::formataRetornoSucessoREST(null, $arrayRetorno, $total); |
| 68 | 83 | } catch (Exception $e) { | ... | ... |