1

我在 symfony 4 中使用这个包,我的过滤代码看起来像这样

{{ knp_pagination_filter(paginator, {
                    't.code': 'Code'
                }) }}

以及我在 /conf/ 目录中的设置文件

knp_paginator:
    page_range:                 5          # default page range used in pagination control
    default_options:
        page_name:              page       # page query parameter name
        sort_field_name:        sort       # sort field query parameter name
        sort_direction_name:    direction  # sort direction query parameter name
        distinct:               true       # ensure distinct results, useful when ORM queries are using GROUP BY statements
        filter_field_name: filterField
        filter_value_name: filterValue
    template:
        pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig'
        sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template
        filtration: '@KnpPaginator/Pagination/filtration.html.twig'  # filters template

没有人面临过滤与过滤器的值非常严格地联系在一起的事实吗?例如:在过滤字段“Apple”中键入时,base 有值“AppleJuice”和“Apple”,我没有看到值“AppleJuice”,只有“Apple”

我可以在其中设置过滤器类型 WHERE '%' + LOWER (param) + '%' LIKE LOWER (item.code)

4

1 回答 1

0

退出,在表服务文件中编写 SQL 查询

于 2019-01-10T11:26:58.040 回答