作者 tangxvhui

调试

... ... @@ -101,7 +101,7 @@ func (c RankController) RankSeasonList() {
}
companyid := c.GetCompanyId()
rspData, err := serverank.RankSeasonList(param.PageIndex, param.PageSize, param.RankTypeId, companyid)
msg = protocol.NewReturnResponse(rspData, err)
msg = protocol.NewPageDataResponse(rspData, err)
return
}
... ... @@ -145,11 +145,15 @@ func (c RankController) RankSeasonAdd() {
return
}
endTime = t2.Unix() + 86399 //60*60*24-1
// ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, 0)
// if !ok {
// msg = protocol.BadRequestParam("10101")
// return
// }
if beginTime < endTime {
msg = protocol.BadRequestParam("1")
return
}
ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, 0)
if !ok {
msg = protocol.BadRequestParam("10101")
return
}
companyid := c.GetCompanyId()
err = serverank.AddRankPeriod(param.RankTypeId, beginTime, endTime, param.Name, companyid)
msg = protocol.NewReturnResponse(nil, err)
... ... @@ -198,11 +202,15 @@ func (c RankController) RankSeasonEdit() {
}
endTime = t2.Unix() + 86399 //60*60*24-1
// ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, param.Id)
// if !ok {
// msg = protocol.BadRequestParam("10101")
// return
// }
if beginTime < endTime {
msg = protocol.BadRequestParam("1")
return
}
ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, param.Id)
if !ok {
msg = protocol.BadRequestParam("10101")
return
}
companyid := c.GetCompanyId()
fmt.Println(beginTime, endTime)
err = serverank.EditRankPeriod(param.Id, beginTime, endTime, param.Name, companyid)
... ...
... ... @@ -199,7 +199,7 @@ func AddRankPeriod(rankTypeId int64, beginTime int64, endTime int64, name string
//RankPeriodCheckTime 设置赛季时检查时间范围的合法性
func RankPeriodCheckTime(rankTypeId int64, beginTime int64, endTime int64, idNot int64) bool {
sql := `SELECT 1 FROM rank_period
sql := `SELECT count(*) FROM rank_period
WHERE rank_type_id = %d
AND id <> %d
AND
... ...