feat(posts): 类型帖截止时间、抽奖奖品表与悬赏发帖体验
统一投票/悬赏/抽奖截止与状态展示,抽奖支持多奖品行;发帖页悬赏积分对齐表格输入,并在余额不足时于底部就地提示。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,6 +78,12 @@ func (h *Handlers) AdminApproveComment(c *gin.Context) {
|
||||
h.writeModerationError(c, err)
|
||||
return
|
||||
}
|
||||
// 抽奖帖主评通过审核后入池(无评论者 IP,回退其最近登录 IP)
|
||||
var cm model.Comment
|
||||
if e := model.DB.Select("id", "post_id", "user_id", "parent_id").First(&cm, uint(id)).Error; e == nil && cm.ParentID == nil {
|
||||
ip := h.Post.LatestSuccessLoginIP(cm.UserID)
|
||||
h.Post.EnsureLotteryEntry(cm.PostID, cm.UserID, cm.ID, ip)
|
||||
}
|
||||
h.broadcastFeedChanged("comment", postID, boardID, actor.ID)
|
||||
h.broadcastModerationChanged()
|
||||
c.JSON(http.StatusOK, gin.H{"message": "操作成功"})
|
||||
|
||||
Reference in New Issue
Block a user