作者 tangxvhui

bug 修复

@@ -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 {
@@ -10,7 +10,7 @@ type PlatformAction interface { @@ -10,7 +10,7 @@ type PlatformAction interface {
10 type CommonProtocol struct { 10 type CommonProtocol struct {
11 Module string `json:"module"` //模块 11 Module string `json:"module"` //模块
12 Action string `json:"action"` //动作 12 Action string `json:"action"` //动作
13 - Data interface{} `json:"data"` //json数据 13 + Data interface{} `json:"data"` //实际的未知数据结构
14 } 14 }
15 15
16 var actionmap = map[string]PlatformAction{ 16 var actionmap = map[string]PlatformAction{