{eyou:assign name="keywords" value="$eyou.field.keywords"}
<!--通过自定义变量assign获取关健词-->
{eyou:sql sql="Select count(*) as AllNum from ey_archives where title like '%$keywords%'" cachetime='-1'}
{$field.AllNum}
<!--返回查询数量为allNum字段-->
{/eyou:sql}
来源:https://www.1920m.com/eyoucms-sousuo/