fix(region):纠正一个可能错误的Where子句用法。
This commit is contained in:
parent
8687b462ff
commit
f8025c5dea
@ -62,7 +62,7 @@ func (_RegionService) fetchRegion(code string) (*model.Region, error) {
|
|||||||
return cachedRegion, nil
|
return cachedRegion, nil
|
||||||
}
|
}
|
||||||
region := new(model.Region)
|
region := new(model.Region)
|
||||||
err := global.DB.NewSelect().Model(®ion).WherePK(code).Scan(ctx)
|
err := global.DB.NewSelect().Model(®ion).Where("code = ?", code).Scan(ctx)
|
||||||
if err != nil && region != nil {
|
if err != nil && region != nil {
|
||||||
relationName := fmt.Sprintf("region:%s", code)
|
relationName := fmt.Sprintf("region:%s", code)
|
||||||
cache.CacheSearch(region, []string{relationName}, "region", code)
|
cache.CacheSearch(region, []string{relationName}, "region", code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user