改進(jìn)了需要引入隨機(jī)數(shù)保證每次刷新重新執(zhí)行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}
注意中文逗號改為英文