...
|
...
|
@@ -190,7 +190,7 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
|
total int
|
|
|
provider *protocol.BaseUserInfo
|
|
|
)
|
|
|
if total, err = models.GetChanceMsg(header.UserId, header.CompanyId, request.LastId, request.PageSize, protocol.MsgTypeAudit, &myChances); err != nil {
|
|
|
if total, err = models.GetChanceMsg(header.UserId, request.LastId, request.PageSize, protocol.MsgTypeAudit, &myChances); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
|
|
return
|
...
|
...
|
@@ -198,26 +198,44 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if provider, err = agg.GetUserBaseInfo(header.UserId, header.CompanyId); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
rsp = &protocol.MsgChanceApproveResponse{Total: total}
|
|
|
for i := 0; i < len(myChances); i++ {
|
|
|
chance := myChances[i]
|
|
|
commItem := protocol.CommonListItem{}
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.Id,
|
|
|
Provider: provider,
|
|
|
//CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
commItem.ReviewStatus = chance.ReviewStatus
|
|
|
if len(chance.SourceContent) == 0 { //机会删除
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
} else if chance.ChanceEnableStatus == 0 { //机会关闭
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusClose
|
|
|
} else {
|
|
|
if provider, err = agg.GetUserBaseInfo(chance.ChanceUserId, header.CompanyId); err != nil {
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
log.Error(err)
|
|
|
continue
|
|
|
} else {
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.ChanceId,
|
|
|
Provider: provider,
|
|
|
CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
}
|
|
|
utils.JsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
item.FormList = agg.ClearEmptyForm(item.FormList)
|
|
|
utils.JsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
utils.JsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
utils.JsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
commItem.Chance = item
|
|
|
}
|
|
|
}
|
|
|
utils.JsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
utils.JsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
utils.JsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
utils.JsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
{
|
|
|
commItem.Chance = item
|
|
|
|
|
|
if chance.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
var approveData *protocol.ApproveData
|
|
|
utils.JsonUnmarshal(chance.ApproveData, &approveData)
|
|
|
if approveData != nil {
|
|
|
commItem.Score = approveData.Score
|
|
|
}
|
|
|
}
|
|
|
//审核完有审核数据
|
|
|
commItem.Message = chance.Message
|
|
|
rsp.List = append(rsp.List, commItem)
|
|
|
}
|
|
|
return
|
...
|
...
|
@@ -226,12 +244,12 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
|
//H5公告详情
|
|
|
func H5Announcement(header *protocol.RequestHeader, request *protocol.AnnouncementRequest) (rsp *protocol.AnnouncementResponse, err error) {
|
|
|
var (
|
|
|
bulletin *models.Bulletin
|
|
|
question *models.BulletinQuestion
|
|
|
userMsg *models.UserMsg
|
|
|
bulletinAnswer *models.BulletinQuestionAnswer
|
|
|
setRead bool = false
|
|
|
answer *protocol.Answer
|
|
|
bulletin *models.Bulletin
|
|
|
question *models.BulletinQuestion
|
|
|
userMsg *models.UserMsg
|
|
|
//bulletinAnswer *models.BulletinQuestionAnswer
|
|
|
setRead bool = false
|
|
|
answer *protocol.Answer
|
|
|
)
|
|
|
if bulletin, err = models.GetBulletinById(request.Id); err != nil {
|
|
|
log.Error(err.Error())
|
...
|
...
|
@@ -268,10 +286,11 @@ func H5Announcement(header *protocol.RequestHeader, request *protocol.Announceme |
|
|
}
|
|
|
|
|
|
//获取回答详情数据
|
|
|
if bulletinAnswer, err = models.GetBulletinQuestionAnswerBy(request.Id, int64(request.Uid)); err == nil {
|
|
|
if bulletinAnswer, e := models.GetBulletinQuestionAnswerBy(request.Id, int64(request.Uid)); e == nil {
|
|
|
if len(bulletinAnswer.Answer) != 0 {
|
|
|
if err = json.Unmarshal([]byte(bulletinAnswer.Answer), &answer); err != nil {
|
|
|
log.Error(err)
|
|
|
log.Error(e)
|
|
|
return
|
|
|
} else {
|
|
|
rsp.Announcement.EditContent = answer.EditContent
|
|
|
rsp.Announcement.VoteResults = answer.VoteResults
|
...
|
...
|
|