|
|
@@ -956,7 +956,11 @@ func GetHsbyProvincesAndCities(provinceID int) ([]Division, error) {
|
|
|
|
|
|
divisions := make([]Division, 0)
|
|
|
session := engine.Where("DIVISIONLEVEL = 'province' or DIVISIONLEVEL = 'city'").
|
|
|
- And("AUTOID in ((select DESCPROVINCEID AUTOID from HSBY_GOODSEX) union all (select DESCCITYID AUTOID from HSBY_GOODSEX))")
|
|
|
+ And(`AUTOID in (
|
|
|
+ (select DESCPROVINCEID AUTOID from HSBY_GOODSEX inner join GOODS on GOODS.GOODSID = HSBY_GOODSEX.GOODSID and GOODS.GOODSSTATUS = 3)
|
|
|
+ union all
|
|
|
+ (select DESCCITYID AUTOID from HSBY_GOODSEX inner join GOODS on GOODS.GOODSID = HSBY_GOODSEX.GOODSID and GOODS.GOODSSTATUS = 3)
|
|
|
+ )`)
|
|
|
if provinceID > 0 {
|
|
|
session = session.And("AUTOID = ?", provinceID)
|
|
|
}
|