|
@@ -163,6 +163,7 @@ func CreateQuestion(userId int, mobile, realName, content string) (err error) {
|
|
|
Mobile: mobile,
|
|
|
RealName: realName,
|
|
|
QuestionContent: content,
|
|
|
+ ReplyStatus: 1,
|
|
|
}
|
|
|
if e := item.Create(); e != nil {
|
|
|
err = errors.New("新增问题失败 Err:" + e.Error())
|
|
@@ -176,7 +177,7 @@ func ReplyUserQuestion(replierId, questionId int, audios []*request.ReplyReqAudi
|
|
|
err = errors.New("获取提问信息失败 Err:" + e.Error())
|
|
|
return
|
|
|
}
|
|
|
- if item.ReplyStatus < 1 {
|
|
|
+ if item.ReplyStatus < 2 {
|
|
|
err = errors.New("回复状态有误")
|
|
|
return
|
|
|
}
|
|
@@ -188,7 +189,7 @@ func ReplyUserQuestion(replierId, questionId int, audios []*request.ReplyReqAudi
|
|
|
updateCols := make([]string, 0)
|
|
|
updateCols = append(updateCols, "reply_status", "reply_time", "modify_time")
|
|
|
nowTime := time.Now().Local()
|
|
|
- item.ReplyStatus = 2
|
|
|
+ item.ReplyStatus = 3
|
|
|
item.ReplyTime = nowTime
|
|
|
item.ModifyTime = nowTime
|
|
|
// 音频
|
|
@@ -205,7 +206,9 @@ func ReplyUserQuestion(replierId, questionId int, audios []*request.ReplyReqAudi
|
|
|
}
|
|
|
if e := yb_community_question.UpdateQuestionAndAudioList(item, updateCols, audioList); e != nil {
|
|
|
err = errors.New("UpdateQuestionAndAudioList Err:" + e.Error())
|
|
|
+ return
|
|
|
}
|
|
|
+ // TODO:推送回复模板消息给提问人
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -238,13 +241,14 @@ func GetReplyListTotal(replierUserId int) (resp *response.CommunityReplyTotal, e
|
|
|
}
|
|
|
resp = new(response.CommunityReplyTotal)
|
|
|
for _, v := range countList {
|
|
|
- if v.ReplyStatus == 1 {
|
|
|
+ if v.ReplyStatus == 2 {
|
|
|
resp.Wait = v.Total
|
|
|
+ continue
|
|
|
}
|
|
|
- if v.ReplyStatus == 2 {
|
|
|
- resp.Repied = v.Total
|
|
|
+ if v.ReplyStatus == 3 {
|
|
|
+ resp.Replied = v.Total
|
|
|
}
|
|
|
}
|
|
|
- resp.Total = resp.Wait + resp.Repied
|
|
|
+ resp.Total = resp.Wait + resp.Replied
|
|
|
return
|
|
|
}
|