|
|
@@ -55,7 +55,7 @@ from (SELECT t1.promnum,
|
|
|
OR NOT EXISTS(SELECT *
|
|
|
FROM sa_promotion_auth
|
|
|
WHERE sa_promotionid = t1.sa_promotionid AND siteid = t1.siteid))
|
|
|
- AND exists(select 1 from sys_enterprise_tradefield where sys_enterpriseid=$sys_enterpriseid$ and sa_saleareaid in(
|
|
|
+ AND (exists(select 1 from sys_enterprise_tradefield where sys_enterpriseid=$sys_enterpriseid$ and sa_saleareaid in(
|
|
|
with recursive salearea as (
|
|
|
select sa_saleareaid
|
|
|
from sa_salearea
|
|
|
@@ -68,6 +68,7 @@ with recursive salearea as (
|
|
|
)
|
|
|
select sa_saleareaid
|
|
|
from salearea))
|
|
|
+OR NOT EXISTS ( SELECT * FROM sa_promotion_salearea WHERE sa_promotionid = t1.sa_promotionid AND siteid = t1.siteid ) )
|
|
|
|
|
|
union all
|
|
|
SELECT t1.promnum,
|