作者 tangxvhui

bug 修复

@@ -31,7 +31,7 @@ func (c AchievementController) AchievementList() { @@ -31,7 +31,7 @@ func (c AchievementController) AchievementList() {
31 } 31 }
32 companyid := c.GetCompanyId() 32 companyid := c.GetCompanyId()
33 rspdata := serveachievement.GetAchievementList(param.PageIndex, param.PageSize, companyid, param.Status) 33 rspdata := serveachievement.GetAchievementList(param.PageIndex, param.PageSize, companyid, param.Status)
34 - msg = protocol.NewReturnResponse(rspdata, nil) 34 + msg = protocol.NewPageDataResponse(rspdata, nil)
35 return 35 return
36 } 36 }
37 37
@@ -96,11 +96,13 @@ func AddAchievement(addData *protocol.RequestAddAchievement, companyid int64) er @@ -96,11 +96,13 @@ func AddAchievement(addData *protocol.RequestAddAchievement, companyid int64) er
96 return protocol.NewErrWithMessage("1") 96 return protocol.NewErrWithMessage("1")
97 } 97 }
98 //操作achievement_provider 成果提供人表 98 //操作achievement_provider 成果提供人表
99 - err = addAchievementProvider(addData.Provider, achievementId, o)  
100 - if err != nil {  
101 - log.Error("添加achievement_provider失败:%s", err)  
102 - o.Rollback()  
103 - return protocol.NewErrWithMessage("1") 99 + if len(addData.Provider) > 0 {
  100 + err = addAchievementProvider(addData.Provider, achievementId, o)
  101 + if err != nil {
  102 + log.Error("添加achievement_provider失败:%s", err)
  103 + o.Rollback()
  104 + return protocol.NewErrWithMessage("1")
  105 + }
104 } 106 }
105 o.Commit() 107 o.Commit()
106 return nil 108 return nil
@@ -163,11 +165,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) @@ -163,11 +165,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64)
163 return protocol.NewErrWithMessage("1") 165 return protocol.NewErrWithMessage("1")
164 } 166 }
165 //操作achievement_provider 成果提供人表 167 //操作achievement_provider 成果提供人表
166 - err = addAchievementProvider(editData.Provider, achievementData.Id, o)  
167 - if err != nil {  
168 - log.Error("添加achievement_provider失败:%s", err)  
169 - o.Rollback()  
170 - return protocol.NewErrWithMessage("1") 168 + if len(editData.Provider) > 0 {
  169 + err = addAchievementProvider(editData.Provider, achievementData.Id, o)
  170 + if err != nil {
  171 + log.Error("添加achievement_provider失败:%s", err)
  172 + o.Rollback()
  173 + return protocol.NewErrWithMessage("1")
  174 + }
171 } 175 }
172 o.Commit() 176 o.Commit()
173 return nil 177 return nil