restrict v7
This commit is contained in:
@@ -55,6 +55,12 @@ func QuestionList(ctx context.Context) {
|
||||
if statusParam != "all" && statusParam != "answered" && statusParam != "unanswered" {
|
||||
statusParam = "all"
|
||||
}
|
||||
// reported 筛选:只看当前有「待处理举报」的提问。
|
||||
// 依赖下方 reportCounts(同一份查询复用),不额外打库。
|
||||
reportedParam := ctx.Query("reported")
|
||||
if reportedParam != "reported" {
|
||||
reportedParam = "all"
|
||||
}
|
||||
typeParam := ctx.Query("type")
|
||||
// 私聊已独立成"私聊"标签页(见 ReceivedChats),不再参与提问列表的类型筛选;
|
||||
// 旧的 type=chat 链接统一归一为"全部",避免空列表。
|
||||
@@ -196,6 +202,9 @@ func QuestionList(ctx context.Context) {
|
||||
if readStatus == 2 && isRead {
|
||||
continue
|
||||
}
|
||||
if reportedParam == "reported" && reportCounts[q.ID] == 0 {
|
||||
continue
|
||||
}
|
||||
itemType := "question_public"
|
||||
if q.IsPrivate {
|
||||
itemType = "question_private"
|
||||
@@ -352,6 +361,7 @@ func QuestionList(ctx context.Context) {
|
||||
ctx.Data["SelectedStatus"] = statusParam
|
||||
ctx.Data["SelectedRead"] = readParam
|
||||
ctx.Data["SelectedType"] = typeParam
|
||||
ctx.Data["SelectedReported"] = reportedParam
|
||||
|
||||
// 我发起的私聊 — 同样使用批量查询与分页(复用 chat_cursor 游标)
|
||||
askerConvs, err := db.Conversations.ListByAsker(ctx.Request().Context(), ctx.User.ID, chatPageSize, int(chatOffset))
|
||||
|
||||
Reference in New Issue
Block a user