改进了需要引入随机数保证每次刷新重新执行sql
{eyou:assign name="keywords" value="$eyou.field.keywords"}
{eyou:sql sql="select COUNT(*) as total from ey_archives"}
{eyou:assign name="rand" value=":rand(0$field.total)"}
{/eyou:sql}
{eyou:sql sql="select aid from ey_archives where title like \'%$keywords%\' order by rand() limit $rand,3"}
{eyou:arcview aid="$field.aid" id="field2"}
<a href="{$field2.arcurl}">{$field2.title}</a>
{/eyou:arcview}
{/eyou:sql}
注意中文逗号改为英文