作者 yangfu

修改 机会详情返回部门信息/保存草稿(非必填部门)

... ... @@ -648,8 +648,9 @@ type ChanceItem struct {
Pictures []Picture `json:"pictures"`
Videos []Video `json:"videos"`
PublicStatus int `json:"-"` //publicStatus
RelatedDepartmentInfo *Dep `json:"relatedDepartment,omitempty"`
PublicStatus int `json:"-"` //publicStatus
RelatedDepartmentId int64 `json:"relatedDepartments" valid:"Required"` //关联部门编号
RelatedDepartmentInfo *Dep `json:"relatedDepartment,omitempty"`
}
type ChanceData struct {
ThumbsUpTotal int `json:"thumbsupTotal"` //点赞总数
... ...
... ... @@ -2013,7 +2013,8 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail
//jsonUnmarshal(chance.SelfChecks, &item.SelfChecks)
item.SelfChecks = agg.GetChanceSelfChecks(chance)
item.FormList = clearEmptyForm(item.FormList)
item.RelatedDepartmentId = chance.DepartmentId
item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId))
if chanceData, err = models.GetChanceDataByChanceId(chance.Id); err == nil {
if len(chanceData.Videos) > 0 {
chanceData.Videos = strings.ReplaceAll(chanceData.Videos, "https", "http")
... ... @@ -2089,6 +2090,7 @@ func ChanceDraftDetail(header *protocol.RequestHeader, request *protocol.ChanceD
CreateTime: chance.CreateAt.Unix() * 1000,
UpdateTime: chance.UpdateAt.Unix() * 1000,
}
item.RelatedDepartmentId = chance.DepartmentId
item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId))
jsonUnmarshal(chance.SourceContent, &item.FormList)
jsonUnmarshal(chance.SelfChecks, &item.SelfChecks)
... ...