|
|
@@ -347,19 +347,25 @@ func (s *ServiceStatisticsLog) statisticsData(ctx context.Context, gameIdInt, tt
|
|
|
return statisticsLog
|
|
|
}
|
|
|
|
|
|
-func (s *ServiceStatisticsLog) OtherStatisticsLogList(ctx context.Context, api log.StatisticsLog, info request.PageInfo, order string, desc bool) (interface{}, int64, error) {
|
|
|
+func (s *ServiceStatisticsLog) OtherStatisticsLogList(ctx context.Context, api log.StatisticsLog, info request.PageInfo, order string, desc bool, gamePortId int) (interface{}, int64, error) {
|
|
|
date := api.CreateDate
|
|
|
if date == "" {
|
|
|
date = s.CurrentDate()
|
|
|
}
|
|
|
|
|
|
- db := global.GVA_DB.Model(&log.StatisticsLog{})
|
|
|
+ db := global.GVA_DB.Table("log_statistics gtc")
|
|
|
+
|
|
|
+ db = db.Joins("left join game_task gt on gt.task_id = gtc.game_id")
|
|
|
if api.GameId != 0 {
|
|
|
- db = db.Where("game_id = ?", api.GameId)
|
|
|
+ db = db.Where("gtc.game_id = ?", api.GameId)
|
|
|
+ }
|
|
|
+ db = db.Where("gtc.create_date = ?", date)
|
|
|
+ if gamePortId != 0 {
|
|
|
+ db = db.Where("gt.game_port_id = ?", gamePortId)
|
|
|
}
|
|
|
- db = db.Where("create_date = ?", date)
|
|
|
var total int64
|
|
|
err := db.Count(&total).Error
|
|
|
+ db = db.Select("gtc.*")
|
|
|
if err != nil {
|
|
|
return nil, 0, err
|
|
|
}
|
|
|
@@ -381,9 +387,9 @@ func (s *ServiceStatisticsLog) OtherStatisticsLogList(ctx context.Context, api l
|
|
|
orderMap["game_id"] = true
|
|
|
if orderMap[order] {
|
|
|
if desc {
|
|
|
- OrderStr = order + " desc"
|
|
|
+ OrderStr = "gtc." + order + " desc"
|
|
|
} else {
|
|
|
- OrderStr = order
|
|
|
+ OrderStr = "gtc." + order
|
|
|
}
|
|
|
} else { // didn't matched any order key in `orderMap`
|
|
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
|
|
@@ -392,7 +398,7 @@ func (s *ServiceStatisticsLog) OtherStatisticsLogList(ctx context.Context, api l
|
|
|
|
|
|
err = db.Order(OrderStr).Find(&statisticsLogs).Error
|
|
|
} else {
|
|
|
- err = db.Order("id").Find(&statisticsLogs).Error
|
|
|
+ err = db.Order("gtc.id").Find(&statisticsLogs).Error
|
|
|
}
|
|
|
if err != nil {
|
|
|
return nil, 0, err
|
|
|
@@ -1072,7 +1078,7 @@ func (s *ServiceStatisticsLog) RegularCheckPc() {
|
|
|
}
|
|
|
ct = fmt.Sprintf("<font color=\"warning\">%s</font>", ct)
|
|
|
ct = c + ct
|
|
|
- go s.SendContent(ct, mpsPerson[name].Url)
|
|
|
+ //go s.SendContent(ct, mpsPerson[name].Url)
|
|
|
}
|
|
|
}
|
|
|
if content != "" {
|