直接调取discuz 群组信息的sql语句

记录一下方便以后使用,sql查询语句!方便二次开发

SELECT t.*,p.message,p.pid,f.name

FROM ".DB::table("forum_thread")." t 

LEFT JOIN ".DB::table("forum_post")." p on p.tid=t.tid 

LEFT JOIN ".DB::table("forum_forum")." f on f.fid=t.fid

WHERE DATE_SUB(CURDATE(), INTERVAL $day DAY) <= FROM_UNIXTIME(t.`dateline`, '%Y-%m-%d') AND t.`fid` not in ($fids) $_digest and t.displayorder>=0 and p.first=1 and t.isgroup = '1'

group by t.tid 

ORDER BY t.`$order` DESC

LIMIT $begin , $num");

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ee9924e2d83c02c77a4698c4c6289201.html