andersao / andersao/l5-repository

Check if int is > 0

オープン
#361 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
4.2k
フォーク
880
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。