andersao / andersao/l5-repository

Check if int is > 0

Abierto
#361 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
PHP
Estrellas
4.2k
Forks
880
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi, I have found a very strange case.

I have a table with an integer field called quantity and I would like to search with $fieldSearchable only if is > 0.

This is my code for $fieldSearchable inside my model

```
protected $fieldSearchable = [
'quantity'=>'>'
];
```

Into my database I have two records: one with quantity 2 and another with quantity 0

If I try to make this request:

`?search=1&searchFields=quantity
`
returns me the first array correctly

If I make this request:

`?search=0&searchFields=quantity`

returns me the first and the second record! But I'm expected to return only the first with quantity 2 not the second with quantity 0

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.