|
|
@@ -33,7 +33,6 @@ func (s *ServiceIpLog) GetIpLogList(api log.IpLogRequest, info request.PageInfo,
|
|
|
db = db.Where("ip = ?", api.Ip)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
db = db.Select("create_date,ip,pc_code,game_id,count(*) as count_total,count(distinct(ip)) as count_distinct_ip")
|
|
|
db = db.Group("pc_code, game_id, create_date")
|
|
|
//db.Select("count(*)").Count(&countTotal)
|
|
|
@@ -76,10 +75,8 @@ func (s *ServiceIpLog) GetIpLogList(api log.IpLogRequest, info request.PageInfo,
|
|
|
|
|
|
func (s *ServiceIpLog) GetIp(iplog log.IpLogResponse) (list interface{}, total int64, err error) {
|
|
|
var ipList []log.QueryIpList
|
|
|
- iplog.CreateDate = time.Now().Format("2006-01-02")
|
|
|
db := global.GVA_DB.Model(&log.IpLog{}).Select("ip, COUNT(1) as count").Where("game_id = ? and pc_code = ? and create_date = ?", iplog.GameId, iplog.PcCode, iplog.CreateDate).Group("ip")
|
|
|
//db.Group("ip").Count(&total)
|
|
|
err = db.Find(&ipList).Count(&total).Error
|
|
|
return ipList, total, err
|
|
|
}
|
|
|
-
|