Merge pull request #7 from yurocy/main

wrong table name
This commit is contained in:
孟帅 2022-06-09 20:12:16 +08:00 committed by GitHub
commit 4ffe54b6ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,8 @@ package com
import (
"context"
"time"
"github.com/axgle/mahonia"
"github.com/bufanyun/hotgo/app/model/entity"
"github.com/bufanyun/hotgo/app/utils"
@ -16,7 +18,6 @@ import (
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"github.com/kayon/iploc"
"time"
)
// IP归属地
@ -151,7 +152,7 @@ func (component *ip) Cz88Find(ctx context.Context, ip string) IpLocationData {
areaModel *entity.SysProvinces
)
err = g.DB().Model("hg_common_provinces").
err = g.DB().Model("hg_sys_provinces").
Where("level", 1).
WhereLike("title", "%"+locationData.Province+"%").
Scan(&provinceModel)
@ -178,7 +179,7 @@ func (component *ip) Cz88Find(ctx context.Context, ip string) IpLocationData {
//替换掉
locationData.City = gstr.Replace(locationData.City, "地区", "")
err = g.DB().Model("hg_common_provinces").
err = g.DB().Model("hg_sys_provinces").
Where("level", 2).
Where("pid", locationData.ProvinceCode).
WhereLike("title", "%"+locationData.City+"%").
@ -199,7 +200,7 @@ func (component *ip) Cz88Find(ctx context.Context, ip string) IpLocationData {
return locationData
}
err = g.DB().Model("hg_common_provinces").
err = g.DB().Model("hg_sys_provinces").
Where("level", 3).
Where("pid", locationData.CityCode).
WhereLike("title", "%"+locationData.Area+"%").