作者 tangxvhui

bug 修复

@@ -49,6 +49,16 @@ func (c AchievementController) AddAchievement() { @@ -49,6 +49,16 @@ func (c AchievementController) AddAchievement() {
49 msg = protocol.BadRequestParam("1") 49 msg = protocol.BadRequestParam("1")
50 return 50 return
51 } 51 }
  52 + if len(param.ChanceData) == 0 {
  53 + log.Error("len(param.ChanceData) == 0 ")
  54 + msg = protocol.BadRequestParam("10109")
  55 + return
  56 + }
  57 + if param.ChanceTypeId == 0 {
  58 + log.Error(" param.ChanceTypeId == 0 ")
  59 + msg = protocol.BadRequestParam("10108")
  60 + return
  61 + }
52 companyid := c.GetCompanyId() 62 companyid := c.GetCompanyId()
53 err := serveachievement.AddAchievement(&param, companyid) 63 err := serveachievement.AddAchievement(&param, companyid)
54 msg = protocol.NewReturnResponse(nil, err) 64 msg = protocol.NewReturnResponse(nil, err)
@@ -69,6 +79,16 @@ func (c AchievementController) EditAchievement() { @@ -69,6 +79,16 @@ func (c AchievementController) EditAchievement() {
69 msg = protocol.BadRequestParam("1") 79 msg = protocol.BadRequestParam("1")
70 return 80 return
71 } 81 }
  82 + if len(param.ChanceData) == 0 {
  83 + log.Error("len(param.ChanceData) == 0 ")
  84 + msg = protocol.BadRequestParam("10109")
  85 + return
  86 + }
  87 + if param.ChanceTypeId == 0 {
  88 + log.Error(" param.ChanceTypeId == 0 ")
  89 + msg = protocol.BadRequestParam("10108")
  90 + return
  91 + }
72 companyid := c.GetCompanyId() 92 companyid := c.GetCompanyId()
73 err := serveachievement.EditAchievement(&param, companyid) 93 err := serveachievement.EditAchievement(&param, companyid)
74 msg = protocol.NewReturnResponse(nil, err) 94 msg = protocol.NewReturnResponse(nil, err)
@@ -114,6 +114,8 @@ var errmessge ErrorMap = map[string]string{ @@ -114,6 +114,8 @@ var errmessge ErrorMap = map[string]string{
114 "10105": "赛季开始时间必填", 114 "10105": "赛季开始时间必填",
115 "10106": "赛季结束时间必填", 115 "10106": "赛季结束时间必填",
116 "10107": "参与范围名称最多输入5个字符", 116 "10107": "参与范围名称最多输入5个字符",
  117 + "10108": "成果一级分类必填",
  118 + "10109": "成果来源必填",
117 } 119 }
118 120
119 //错误码转换 ,兼容需要 121 //错误码转换 ,兼容需要
@@ -214,6 +214,7 @@ func GetAchievementList(pageIndex int, pageSize int, companyId int64, status int @@ -214,6 +214,7 @@ func GetAchievementList(pageIndex int, pageSize int, companyId int64, status int
214 log.Error("SQL EXECUTE ERR:%s", err) 214 log.Error("SQL EXECUTE ERR:%s", err)
215 return rspData 215 return rspData
216 } 216 }
  217 + rspData.TotalPage = cnt
217 if cnt == 0 { 218 if cnt == 0 {
218 return rspData 219 return rspData
219 } 220 }