作者 tangxvhui

bug 修复

... ... @@ -31,7 +31,7 @@ func (c AchievementController) AchievementList() {
}
companyid := c.GetCompanyId()
rspdata := serveachievement.GetAchievementList(param.PageIndex, param.PageSize, companyid, param.Status)
msg = protocol.NewReturnResponse(rspdata, nil)
msg = protocol.NewPageDataResponse(rspdata, nil)
return
}
... ...
... ... @@ -96,11 +96,13 @@ func AddAchievement(addData *protocol.RequestAddAchievement, companyid int64) er
return protocol.NewErrWithMessage("1")
}
//操作achievement_provider 成果提供人表
err = addAchievementProvider(addData.Provider, achievementId, o)
if err != nil {
log.Error("添加achievement_provider失败:%s", err)
o.Rollback()
return protocol.NewErrWithMessage("1")
if len(addData.Provider) > 0 {
err = addAchievementProvider(addData.Provider, achievementId, o)
if err != nil {
log.Error("添加achievement_provider失败:%s", err)
o.Rollback()
return protocol.NewErrWithMessage("1")
}
}
o.Commit()
return nil
... ... @@ -163,11 +165,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64)
return protocol.NewErrWithMessage("1")
}
//操作achievement_provider 成果提供人表
err = addAchievementProvider(editData.Provider, achievementData.Id, o)
if err != nil {
log.Error("添加achievement_provider失败:%s", err)
o.Rollback()
return protocol.NewErrWithMessage("1")
if len(editData.Provider) > 0 {
err = addAchievementProvider(editData.Provider, achievementData.Id, o)
if err != nil {
log.Error("添加achievement_provider失败:%s", err)
o.Rollback()
return protocol.NewErrWithMessage("1")
}
}
o.Commit()
return nil
... ...