AI智能回复搜索中,请稍后...
看了一下表结构,有两个解决思路。
1、整体配置法
即在 用户管理-通知配置 里面,编辑具体的通知。
比如,
回答被设为最佳 | BEST_ANSWER |
即点击 编辑,通知类型:中,站内通知 和邮件通知 是勾选的。
把邮件通知取消勾选,设定就会变成 site。
如果想批量把全部都改成站内通知,一个个点太麻烦了。
直接SQL吧:
UPDATE aws_users_notify_setting
SET type = 'site'
WHERE type = 'site,email'
执行结果:
UPDATE aws_users_notify_setting
SET type = 'site'
WHERE type = 'site,email'
> Affected rows: 29
> 时间: 0.055s
但这么操作的缺点是:用户界面就不会有任何勾选的可能性了,连勾选框都没了。
当然了,如果本来就不想让用户勾选,这么干当然666。
2、单独配置法
我们不折腾全局的配置表了。看看用户配置写在哪里。
用户的默认通知设置信息,在aws_users_extends表中。
只需要给每一个用户都写入相同的设置项,就可以实现有勾选框,但是默认不勾选,的效果。
怎么写入呢?
当然是找一个用户的数据样板,然后把这个样板克隆到所有和克隆体不同的用户身上。
UPDATE aws_users_extends
SET notify_setting = '{"site":["BEST_ANSWER","TYPE_PEOPLE_FOCUS_ME","QUESTION_ANSWER","QUESTION_COMMENT_AT_ME","QUESTION_ANSWER_COMMENT_AT_ME","NEW_ANSWER_COMMENT","INVITE_ANSWER","NEW_ARTICLE_COMMENT","ARTICLE_COMMENT_AT_ME","NEW_QUESTION_COMMENT","AGREE_CONTENT","TYPE_QUESTION_APPROVAL","TYPE_ARTICLE_APPROVAL","TYPE_QUESTION_DECLINE","TYPE_ARTICLE_DECLINE","TYPE_QUESTION_MODIFY_APPROVAL","TYPE_ARTICLE_MODIFY_APPROVAL","TYPE_ANSWER_APPROVAL","TYPE_ANSWER_MODIFY_APPROVAL","TYPE_QUESTION_MODIFY_DECLINE","TYPE_ARTICLE_MODIFY_DECLINE","TYPE_ANSWER_DECLINE","TYPE_ANSWER_MODIFY_DECLINE","TYPE_COLUMN_APPROVAL","TYPE_COLUMN_DECLINE"]}'
WHERE
notify_setting !='{"site":["BEST_ANSWER","TYPE_PEOPLE_FOCUS_ME","QUESTION_ANSWER","QUESTION_COMMENT_AT_ME","QUESTION_ANSWER_COMMENT_AT_ME","NEW_ANSWER_COMMENT","INVITE_ANSWER","NEW_ARTICLE_COMMENT","ARTICLE_COMMENT_AT_ME","NEW_QUESTION_COMMENT","AGREE_CONTENT","TYPE_QUESTION_APPROVAL","TYPE_ARTICLE_APPROVAL","TYPE_QUESTION_DECLINE","TYPE_ARTICLE_DECLINE","TYPE_QUESTION_MODIFY_APPROVAL","TYPE_ARTICLE_MODIFY_APPROVAL","TYPE_ANSWER_APPROVAL","TYPE_ANSWER_MODIFY_APPROVAL","TYPE_QUESTION_MODIFY_DECLINE","TYPE_ARTICLE_MODIFY_DECLINE","TYPE_ANSWER_DECLINE","TYPE_ANSWER_MODIFY_DECLINE","TYPE_COLUMN_APPROVAL","TYPE_COLUMN_DECLINE"]}'
然后,效果是:
是不是强迫症被治愈了呢?
当然,最好是官方能够给一个界面,让管理员可以设定新用户在aws_users_extends表中notify_setting字段的的默认值。