fastadmin开发手册

自定义过滤条件


自定义过滤条件,用于当我们的标签满足不了我们的筛选条件时使用,可以支持自定义SQL。

支持范围


| 名称 | 支持情况 | 名称 | 支持情况 |
| --- | --- | --- | --- |
| nav | 支持 | execute | 不支持 |
| query | 不支持 | prevnext | 支持 |
| arclist | 支持 | arclist | 支持 |
| blocklist | 支持 | commentlist | 支持 |
| breadcrumb | 不支持 | channelinfo | 支持 |
| channellist | 支持 | arclist | 支持 |
| pagelist | 不支持 | speciallist | 支持 |
| taglist | 支持 | userlist | 支持 |
| diydatalist | 支持 | pagefilter | 不支持 |
| pageorder | 不支持 | spagelist | 支持 |
| spageinfo | 支持 | pageinfo | 不支持 |
| commentinfo | 不支持 | | |

使用示例


支持固定的SQL语句和动态的SQL语句,字段名首尾务必加上字符,在使用动态SQL时由于使用拼接SQL,请务必做好参数过滤

`html

{cms:arclist id="item" row="8" orderby="id" orderway="desc" condition="
views>1000"}
{/cms:arclist}

{cms:arclist id="item" row="8" orderby="id" orderway="desc" condition="
diyname='test' "}
{/cms:arclist}



{php}$views=intval($GET['views']);{/php}
{cms:arclist id="item" row="8" orderby="id" orderway="desc" condition="
views >$views"}
{/cms:arclist}
``

为了你的站点安全,强烈建议condition条件中不要拼接字符串查询,数字请使用intval做过好滤,会有安全隐患。如果使用了字符串拼接,请务必做好过滤,如使用striptags、xss_clean、htmlspecialchars做好过滤。


使用别名


当我们在arclist标签中使用condition时,可能会调用到主副表,可以在condition中使用主表facmsarchives的别名a,副表facmsaddonxxx的别名n。

10 Screens$8,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery 1 Revision
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

20 Screens$16,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

30 Screens$24,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages
0.514899s