|
@@ -14,7 +14,12 @@ FROM sa_order t1
|
|
|
LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid
|
|
|
AND t1.siteid = t2.siteid
|
|
|
WHERE t1.STATUS = '审核'
|
|
|
- and t1.sys_enterpriseid=$sys_enterpriseid$
|
|
|
- and exists (select 1 from sa_orderitems where (ifnull(undeliqty, 0)!=0 and ifnull(isclose, 0 )= 0 and ifnull(isfreeze, 0 )= 0) and sa_orderid=t1.sa_orderid)
|
|
|
+ and t1.sys_enterpriseid = $sys_enterpriseid$
|
|
|
+ and exists(select 1
|
|
|
+ from sa_orderitems orderitems
|
|
|
+ where (ifnull(orderitems.undeliqty, 0) != 0 and ifnull(orderitems.isclose, 0) = 0 and
|
|
|
+ ifnull(orderitems.isfreeze, 0) = 0)
|
|
|
+ and orderitems.sa_orderid = t1.sa_orderid)
|
|
|
AND t1.siteid = $siteid$
|
|
|
- and $where$ and $tablefilter$
|
|
|
+ and $where$
|
|
|
+ and $tablefilter$
|