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