yfc / search-parser
Inno PHP 库
1.0.0
2018-09-10 15:55 UTC
Requires
- php: >=5.6
- avris/bag: ~3.0
- doctrine/dbal: ^2.6
- laravel/framework: ~5.3
Requires (Dev)
- phpunit/phpunit: ~5.7
This package is auto-updated.
Last update: 2024-10-01 00:07:36 UTC
README
使用 JavaCC 替代
安装
composer require yufangcheng/search-parser
将以下提供者添加到 config/app.app
Inno\Lib\SearchParser\Providers\SearchParserServiceProvider::class
然后运行以下命令
php artisan vendor:publish
示例
http://example.com/api/users?q=id:1
http://example.com/api/users?email~"*@gmail.com"
http://example.com/api/users?id:<1,2,3>
http://example.com/api/users?id:NOT <1,2,3>
http://example.com/api/users?id:[1 TO 100]
http://example.com/api/users?q=created_at:["-3 months" TO "now"] AND id:NOT [1 TO 100] OR (email:"*@vip.patsnap.com" OR id:888)&sort=id desc&fl=id,email&with=profile
为了避免浏览器或服务器截断过长的URL
使用名为 search 的可选头传递查询字符串。