fix(region):修正行政区划中的查询错误。
This commit is contained in:
parent
0d062560da
commit
1c0ebc9559
@ -61,8 +61,8 @@ func (_RegionService) fetchRegion(code string) (*model.Region, error) {
|
||||
return cachedRegion, nil
|
||||
}
|
||||
region := new(model.Region)
|
||||
err := global.DB.NewSelect().Model(®ion).Where("code = ?", code).Scan(ctx)
|
||||
if err != nil && region != nil {
|
||||
err := global.DB.NewSelect().Model(region).Where("code = ?", code).Scan(ctx)
|
||||
if err != nil {
|
||||
relationName := fmt.Sprintf("region:%s", code)
|
||||
cache.CacheSearch(region, []string{relationName}, "region", code)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user