Browse Source

信息中心V1.3.9

kaick 1 năm trước cách đây
mục cha
commit
2854e2241a

+ 8 - 1
src/main/java/com/caimei/www/service/page/impl/ProductServiceImpl.java

@@ -101,7 +101,14 @@ public class ProductServiceImpl implements ProductService {
 
     @Override
     public List<ProductList> getProductSellNumbers() {
-        return productDao.getProductSellNumbers();
+        List<ProductList> productSellNumbers = productDao.getProductSellNumbers();
+        if (null != productSellNumbers && productSellNumbers.size() > 0) {
+            productSellNumbers.forEach(product -> {
+                // 设置 图片路径
+                product.setImage(ImageUtil.getImageURL("product", product.getImage(), 0, domain));
+            });
+        }
+        return productSellNumbers;
     }
 
     /**

+ 3 - 0
src/main/resources/mapper/ProductMapper.xml

@@ -112,6 +112,9 @@
 			p.`name` as `name`,
 			p.mainImage as image
 		from product as p
+		left join cm_organize_product_info copi on copi.productId = p.productId
+		where copi.validFlag  = 2
+		  and copi.organizeId = 0
 		order by sellNumber desc limit 0,3
 	</select>
     <select id="getPriceItemById" resultType="com.caimei.www.pojo.order.CartItem">

+ 1 - 1
src/main/resources/templates/article/components/article-drawer.html

@@ -42,7 +42,7 @@
         <div class="hot-recommend-content-item" th:each="product: ${productSellNumbers}">
           <div>
             <a th:href="'/product-'+${product.id}+'.html'" target="_blank">
-              <img th:src="product.image" style="width: 100%;height: 100%;object-fit: contain;" />
+              <img th:src="${product.image}" style="width: 100%;height: 100%;object-fit: contain;" />
             </a>
           </div>
           <div th:text="${product.name}"></div>

+ 1 - 1
src/main/resources/templates/article/components/article-sidebar.html

@@ -37,7 +37,7 @@
         <div class="row" th:each="product: ${productSellNumbers}" >
             <div class="new-img xiao">
                 <a th:href="'/product-'+${product.id}+'.html'" target="_blank">
-                    <img th:src="product.image"/>
+                    <img th:src="${product.image}"/>
                 </a>
             </div>
             <div class="new-blurb xiao">