Explorar o código

查询促销方案中的商品列表去掉商品档案状态判断

eganwu hai 1 ano
pai
achega
969a01d0f8

+ 1 - 0
src/custom/restcontroller/webmanage/sale/order/PromotionOrder.java

@@ -82,6 +82,7 @@ public class PromotionOrder extends Controller {
             sys_enterpriseid = orderRows.get(0).getLong("sys_enterpriseid");
         }
 
+        where.append(" and t1.itemid in (SELECT itemid from sa_promotion_items WHERE (islimit=0 or groupqty>saledqty) and sa_promotionid="+sa_promotionid+" and isonsale=1 )");
 
 //        ArrayList<Long> itemids = getOrderItemsList(sa_orderid, sa_promotionid);
 //        itemids.add(-1L);

+ 1 - 2
src/custom/restcontroller/webmanage/sale/order/SQL/促销方案商品列表.sql

@@ -26,12 +26,11 @@ SELECT t1.itemid,
        t5.price
 from plm_item t1
          LEFT JOIN plm_unitgroup t2 ON t2.unitgroupid = t1.unitgroupid and t2.siteid = t1.siteid
-         LEFT JOIN sa_promotion_items t3 ON t3.itemid = t1.itemid and t3.siteid = t1.siteid and t3.isonsale=1 and (t3.groupqty>t3.saledqty or t3.islimit=0)
+         LEFT JOIN sa_promotion_items t3 ON t3.itemid = t1.itemid and t3.siteid = t1.siteid
          LEFT JOIN sa_promotion_itemprice t5
                    ON t5.sa_promotion_itemsid = t3.sa_promotion_itemsid and t5.siteid = t3.siteid and t5.sa_promotionid = t3.sa_promotionid
          LEFT JOIN sys_enterprise t6 ON t6.grade = t5.pricegrade and t6.siteid = t5.siteid
 WHERE t1.siteid = $siteid$
-  and t1.status = '审核'
   and t3.sa_promotionid = $sa_promotionid$
   and t6.sys_enterpriseid = $sys_enterpriseid$
   and $where$