Browse Source

促销方案可售量更新逻辑变更

hu 2 năm trước cách đây
mục cha
commit
7b73944971
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/custom/restcontroller/webmanage/sale/order/Order.java

+ 3 - 3
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -1123,7 +1123,7 @@ public class Order extends Controller {
         String sonum = row.getString("sonum");
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {
@@ -1599,7 +1599,7 @@ public class Order extends Controller {
 
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {
@@ -1675,7 +1675,7 @@ public class Order extends Controller {
 
         String type = row.getString("type");
         if (type.equals("促销订单")) {
-            Rows orderdetails = dbConnect.runSqlQuery("select * from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid);
+            Rows orderdetails = dbConnect.runSqlQuery("select sa_promotion_itemsid,itemno,sum(qty) qty  from sa_orderitems where siteid='" + siteid + "' and sa_orderid=" + sa_orderid +" group by sa_promotion_itemsid,itemno");
             Rows promotionitems = dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='" + siteid + "' and sa_promotionid=" + row.getLong("sa_promotionid"));
             RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
             for (Row orderdetail : orderdetails) {