Просмотр исходного кода

退回时限购金额逻辑优化

hu 2 месяцев назад
Родитель
Сommit
5151be50cc
1 измененных файлов с 1 добавлено и 6 удалено
  1. 1 6
      src/custom/restcontroller/webmanage/sale/order/Order.java

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

@@ -2321,12 +2321,7 @@ public class Order extends Controller {
                 Rows promotion = dbConnect.runSqlQuery("select * from sa_promotion where siteid='" + siteid + "'and  sa_promotionid=" + sa_promotionid);
                 if (islimit) {
                     if (promotion.isNotEmpty()) {
-                        Rows amountrows = dbConnect.runSqlQuery("select sum(amount) amount from sa_cashbill where ownerid='" + sa_orderid + "' and ownertable='sa_order' and sa_accountclassid=" + promotion.get(0).getLong("sa_accountclassid"));
-                        if (amountrows.isNotEmpty()) {
-                            if (amountrows.get(0).getBigDecimal("amount").compareTo(BigDecimal.ZERO) > 0) {
-                                sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amountrows.get(0).getBigDecimal("amount") + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
-                            }
-                        }
+                        sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amount + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
                     }
 
                 }