|
|
@@ -77,7 +77,7 @@ 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{}).Distinct("ip").Where("game_id = ? and pc_code = ? and create_date = ?", iplog.GameId, iplog.PcCode, iplog.CreateDate)
|
|
|
+ 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
|