forked from free-lancers/electricity_bill_calc_service
		
	fix(region):修正行政区划中的查询错误。
This commit is contained in:
		| @@ -61,8 +61,8 @@ 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).Where("code = ?", code).Scan(ctx) | 	err := global.DB.NewSelect().Model(region).Where("code = ?", code).Scan(ctx) | ||||||
| 	if err != nil && region != nil { | 	if err != 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) | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user