suochencheng 7 lat temu
rodzic
commit
313a7281a9

+ 2 - 2
src/main/java/com/izouma/awesomeadmin/dao/ProductPriceMapper.xml

@@ -96,7 +96,7 @@
             <if test="minCounts!= null">
             <if test="minCounts!= null">
                 min_counts,
                 min_counts,
             </if>
             </if>
-            <if test="maxCounts!= null">
+            <if test="maxCounts!= null and maxCounts&gt;0">
                 max_counts,
                 max_counts,
             </if>
             </if>
             <if test="inventory!= null">
             <if test="inventory!= null">
@@ -140,7 +140,7 @@
             <if test="minCounts != null">
             <if test="minCounts != null">
                 #{minCounts,jdbcType=INTEGER},
                 #{minCounts,jdbcType=INTEGER},
             </if>
             </if>
-            <if test="maxCounts != null">
+            <if test="maxCounts != null and maxCounts&gt;0">
                 #{maxCounts,jdbcType=INTEGER},
                 #{maxCounts,jdbcType=INTEGER},
             </if>
             </if>
             <if test="inventory != null">
             <if test="inventory != null">

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/service/impl/UserOrderServiceImpl.java

@@ -170,7 +170,7 @@ public class UserOrderServiceImpl implements UserOrderService {
                                 unitPrice = productPrice.getPrice();
                                 unitPrice = productPrice.getPrice();
                             } else if (productPrice.getMinCounts() == null
                             } else if (productPrice.getMinCounts() == null
                                     && productPrice.getMaxCounts() != null
                                     && productPrice.getMaxCounts() != null
-                                    && record.getQuantity() < productPrice.getMinCounts()) {
+                                    && record.getQuantity() <= productPrice.getMaxCounts()) {
                                 unitPrice = productPrice.getPrice();
                                 unitPrice = productPrice.getPrice();
                             }
                             }
                         }
                         }