模板首页随机调用小说

menglicl   ·   发表于 5个月前   ·   多选小说


//修改模板里 index.gohtml里
    {{$sql := printf "SELECT {articleField} FROM {prefix}article_article WHERE sortid = %d ORDER BY monthvisit DESC LIMIT 10" $i}}
为
{{$sql := printf "SELECT {articleField} FROM (SELECT {articleField} FROM {prefix}article_article WHERE sortid = %d ORDER BY RAND() LIMIT 40) AS subquery ORDER BY RAND() LIMIT 10" $i}}

此时模板首页将会变成随机调用小说


打赏我,让我更有动力~

0 Reply   |  Until 5个月前 | 188 View
LoginCan Publish Content
每日签到
1人
连续签到0天