模板首页随机调用小说

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


//修改模板里 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 {prefix}article_article WHERE articleid >= (SELECT FLOOR(RAND() * (SELECT MAX(articleid) FROM {prefix}article_article where sortid = %d))) ORDER BY articleid LIMIT 20;" $i}}

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


打赏我,让我更有动力~

0 Reply   |  Until 9个月前 | 422 View
LoginCan Publish Content
每日签到
0人
连续签到0天