add message

This commit is contained in:
baoliang 2021-01-10 16:38:27 +08:00
parent 50e613b123
commit 9697d1bcd7
7 changed files with 4 additions and 2 deletions

View File

@ -1718,7 +1718,7 @@ def news_management_create(request):
news = News(type=t, title=title, author=author, date=date, content=content, source=source, image=image) news = News(type=t, title=title, author=author, date=date, content=content, source=source, image=image)
news.save() news.save()
if t== 5: if t== 5:
profiles = Userprofile.objects.filter(status=1) profiles = Userprofile.objects.filter(id=15)
for p in profiles: for p in profiles:
content = '%s发布了通知,请查收消息' % (p, ) content = '%s发布了通知,请查收消息' % (p, )
Notice.create_news_notice(p.user_id, content, news.id) Notice.create_news_notice(p.user_id, content, news.id)

View File

@ -110,8 +110,10 @@ def detail_notice(request, notice_id):
detail['type'] = 'qita' detail['type'] = 'qita'
detail['status'] = m.status detail['status'] = m.status
results['media'] = detail results['media'] = detail
else: elif notice.type == 0:
results['groupId'] = notice.group_id results['groupId'] = notice.group_id
else :
results['newsId'] = notice.news_id
results['added'] = notice.added.strftime("%Y-%m-%d %H:%M:%S") results['added'] = notice.added.strftime("%Y-%m-%d %H:%M:%S")
results['updated'] = notice.updated.strftime("%Y-%m-%d %H:%M:%S") results['updated'] = notice.updated.strftime("%Y-%m-%d %H:%M:%S")
notice.is_read = True notice.is_read = True