wanglang преди 1 седмица
родител
ревизия
59ce805d20
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      trade-service/src/main/java/com/trade/service/trade/salesorder/service/impl/SalesOrderGoodsServiceImpl.java

+ 2 - 1
trade-service/src/main/java/com/trade/service/trade/salesorder/service/impl/SalesOrderGoodsServiceImpl.java

@@ -44,6 +44,7 @@ public class SalesOrderGoodsServiceImpl extends ServiceImpl<SalesOrderGoodsMappe
 
     @Override
     public SalesOrderGoods getMaxAmountByIds(List<Long> ids) {
-        return this.lambdaQuery().in(SalesOrderGoods::getId, ids).orderByDesc(SalesOrderGoods::getPriceTotal).one();
+        return this.lambdaQuery().in(SalesOrderGoods::getId, ids).orderByDesc(SalesOrderGoods::getPriceTotal)
+                .last("limit 1").one();
     }
 }