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

分享时间:2017-11-23 6462 热度℃

记录一下方便以后使用,sql查询语句!方便二次开发
  1. SELECT t.*,p.message,p.pid,f.name
  2. FROM ".DB::table("forum_thread")." t
  3. LEFT JOIN ".DB::table("forum_post")." p on p.tid=t.tid
  4. LEFT JOIN ".DB::table("forum_forum")." f on f.fid=t.fid
  5. 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'
  6. group by t.tid
  7. ORDER BY t.`$order` DESC
  8. LIMIT $begin , $num");
复制代码
本文标签:
返回顶部