<?php $randnum=10; //随机数量 $randids=''; $randdh=''; for($i=1;$i<=$randnum;$i++) { $randids.=$randdh.rand(1,1000000); //1为最小ID,100000为最大ID $randdh=','; } ?> [e:loop={'selfinfo',10,0,0,"id in ($randids)"}] <a href="<?=$bqsr[titleurl]?>" class="flex group"> <div class="w-8 h-8 rounded bg-primary text-white flex items-center justify-center flex-shrink-0 mr-3"> <?=$bqno?> <!-- 自动显示序号 --> </div> <div> <h4 class="text-sm font-medium line-clamp-2 group-hover:text-primary transition-custom"> <?=esub($bqr[title],50)?> </h4> <p class="text-xs text-gray-custom mt-1"> <?=date('m-d', $bqr['newstime'])?> · <?=$bqr['onclick']?>阅读 </p> </div> </a> [/e:loop]
|