...
|
...
|
@@ -144,7 +144,7 @@ func AllowRank(id int64, companyid int64) error { |
|
|
}
|
|
|
|
|
|
//RankSeasonList ..获取赛季列表
|
|
|
func RankSeasonList(pageindex int, pagesize int, companyid int64) (protocol.ResponseRankSeasonList, error) {
|
|
|
func RankSeasonList(pageindex int, pagesize int, rankTypeId int64, companyid int64) (protocol.ResponseRankSeasonList, error) {
|
|
|
var (
|
|
|
err error
|
|
|
listdata []protocol.RankSeasonItem
|
...
|
...
|
@@ -157,10 +157,10 @@ func RankSeasonList(pageindex int, pagesize int, companyid int64) (protocol.Resp |
|
|
List: make([]protocol.RankSeasonItem, 0),
|
|
|
}
|
|
|
pageStart := (pageindex - 1) * pagesize
|
|
|
datasql := `SELECT id,season_name,begin_time,end_time,status FROM rank_period WHERE company_id = ?`
|
|
|
datasql := `SELECT id,season_name,begin_time,end_time,status FROM rank_period WHERE company_id = ? AND rank_type_id=? `
|
|
|
datasql = fmt.Sprintf("%s ORDER BY begin_time DESC limit %d,%d", datasql, pageStart, pagesize)
|
|
|
countsql := `SELECT COUNT(*) FROM rank_period WHERE company_id = ?`
|
|
|
err = utils.ExecuteQueryOne(&cnt, countsql, companyid)
|
|
|
countsql := `SELECT COUNT(*) FROM rank_period WHERE company_id = ? AND rank_type_id=? `
|
|
|
err = utils.ExecuteQueryOne(&cnt, countsql, companyid, rankTypeId)
|
|
|
if err != nil {
|
|
|
log.Error("EXCUTE SQL ERR:%s", err)
|
|
|
return rspData, nil
|
...
|
...
|
@@ -168,7 +168,7 @@ func RankSeasonList(pageindex int, pagesize int, companyid int64) (protocol.Resp |
|
|
if cnt <= 0 {
|
|
|
return rspData, nil
|
|
|
}
|
|
|
err = utils.ExecuteQueryAll(&listdata, datasql, companyid)
|
|
|
err = utils.ExecuteQueryAll(&listdata, datasql, companyid, rankTypeId)
|
|
|
if err != nil {
|
|
|
log.Error("EXCUTE SQL ERR:%s", err)
|
|
|
return rspData, nil
|
...
|
...
|
|