|
@@ -193,11 +193,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
|
@@ -193,11 +193,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
193
|
log.Info("删除achievement_provider数据失败:%s", err)
|
193
|
log.Info("删除achievement_provider数据失败:%s", err)
|
194
|
return protocol.NewErrWithMessage("1")
|
194
|
return protocol.NewErrWithMessage("1")
|
195
|
}
|
195
|
}
|
196
|
- err = addAchievementProvider(editData.Provider, achievementData.Id, o)
|
|
|
197
|
- if err != nil {
|
|
|
198
|
- log.Error("添加achievement_provider失败:%s", err)
|
|
|
199
|
- o.Rollback()
|
|
|
200
|
- return protocol.NewErrWithMessage("1")
|
196
|
+ if len(editData.Provider) > 0 {
|
|
|
197
|
+ err = addAchievementProvider(editData.Provider, achievementData.Id, o)
|
|
|
198
|
+ if err != nil {
|
|
|
199
|
+ log.Error("添加achievement_provider失败:%s", err)
|
|
|
200
|
+ o.Rollback()
|
|
|
201
|
+ return protocol.NewErrWithMessage("1")
|
|
|
202
|
+ }
|
201
|
}
|
203
|
}
|
202
|
err = models.IncreaseAchevementScore(companyid, newRamain-oldRemain, o)
|
204
|
err = models.IncreaseAchevementScore(companyid, newRamain-oldRemain, o)
|
203
|
if err != nil {
|
205
|
if err != nil {
|