DISCUZ网站各种垃圾回复广告批量删除

tpkline 6月前 511

DELETE FROM pre_forum_postcomment WHERE `rpid` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));

DELETE FROM pre_forum_post_moderate WHERE `id` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));

DELETE FROM pre_forum_post_location WHERE `pid` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));

DELETE FROM pre_forum_filter_post WHERE `pid` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));

DELETE FROM pre_forum_hotreply_number WHERE `pid` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));

DELETE FROM pre_forum_hotreply_member WHERE `pid` IN(select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01'));
DELETE FROM pre_forum_post WHERE first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01');

其中需要删除的条件是[backcolor=rgb(247, 247, 247)]select group_concat(pid) from pre_forum_post where first=0 and authorid !=1 and dateline > unix_timestamp('2018-01-01')[/backcolor][backcolor=rgb(247, 247, 247)]条件说明:first=0就是回复贴,[/backcolor][backcolor=rgb(247, 247, 247)]authorid就是当前内容回复作者,[/backcolor][backcolor=rgb(247, 247, 247)]authorid !=1就是不删除管理员id为1的回复贴,[/backcolor][backcolor=rgb(247, 247, 247)]dateline是发布时间 这里设置删除发布时间在2018年1月1号后的回复贴。[/backcolor]
提示:运行sql语句删除数据前,请备份好数据,以免造成不必要的数据丢失风险。[backcolor=rgb(247, 247, 247)]
[/backcolor]

最新回复 (0)
返回
发新帖