|
|
@@ -210,7 +210,7 @@ func (s *GameTask) GetControlTaskId(gameId int) (d *ControlTaskId, err error) {
|
|
|
//@description: 分页获取数据,
|
|
|
//@param: card card.Card, info request.PageInfo, order string, desc bool
|
|
|
//@return: list interface{}, total int64, err error
|
|
|
-func (apiService *GameTask) GetGameTaskInfoList(api task.GameTask, info request.PageInfo, order string, desc bool) (list interface{}, total int64, err error) {
|
|
|
+func (apiService *GameTask) GetGameTaskInfoList(api task.GameTask, info request.PageInfo, order string, desc bool) (list interface{}, options interface{}, total int64, err error) {
|
|
|
limit := info.PageSize
|
|
|
offset := info.PageSize * (info.Page - 1)
|
|
|
db := global.GVA_DB.Model(&task.GameTask{})
|
|
|
@@ -230,8 +230,20 @@ func (apiService *GameTask) GetGameTaskInfoList(api task.GameTask, info request.
|
|
|
|
|
|
err = db.Count(&total).Error
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ //查找厂商名称,登录类型名称、账号类型名称
|
|
|
+ option := task.Option{}
|
|
|
+ global.GVA_DB.Table("game_channel").Select("id","channel_name").Find(&option.GamePortOptions)
|
|
|
+ global.GVA_DB.Table("login_type").Select("id", "login_name").Find(&option.LoginTypeOptions)
|
|
|
+ global.GVA_DB.Table("account_type").Select("id", "type_name").Find(&option.AccountTypeOptions)
|
|
|
+ global.GVA_DB.Table("game_list").Select("id", "game_name").Find(&option.GameListOptions)
|
|
|
+ //fmt.Println(option)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if err != nil {
|
|
|
- return apiList, total, err
|
|
|
+ return apiList, option , total, err
|
|
|
} else {
|
|
|
db = db.Limit(limit).Offset(offset)
|
|
|
if order != "" {
|
|
|
@@ -250,7 +262,7 @@ func (apiService *GameTask) GetGameTaskInfoList(api task.GameTask, info request.
|
|
|
}
|
|
|
} else { // didn't matched any order key in `orderMap`
|
|
|
err = fmt.Errorf("非法的排序字段: %v", order)
|
|
|
- return apiList, total, err
|
|
|
+ return apiList, option, total, err
|
|
|
}
|
|
|
|
|
|
err = db.Order(OrderStr).Find(&apiList).Error
|
|
|
@@ -285,7 +297,7 @@ func (apiService *GameTask) GetGameTaskInfoList(api task.GameTask, info request.
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- return apisReply, total, err
|
|
|
+ return apisReply, option, total, err
|
|
|
}
|
|
|
|
|
|
//@author: [piexlmax](https://github.com/piexlmax)
|