小程序主页接口修改
This commit is contained in:
parent
9893d5ecb0
commit
643cbccae9
|
|
@ -1,6 +1,7 @@
|
|||
package com.czg.account.vo.home;
|
||||
|
||||
import com.czg.product.entity.Product;
|
||||
import com.czg.product.vo.RecommendProVO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -15,6 +16,6 @@ public class HotRankingVO {
|
|||
*/
|
||||
private String name = "飙升热榜";
|
||||
private String date = "8点更新";
|
||||
List<Product> hotList;
|
||||
List<RecommendProVO> hotList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.product.vo;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -61,5 +62,6 @@ public class RecommendProVO {
|
|||
* 折扣
|
||||
*/
|
||||
private float discount;
|
||||
@Column(ignore = true)
|
||||
private Long endTime = 1741391999999L;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public interface ProductMapper extends BaseMapper<Product> {
|
|||
|
||||
ShopProductInfoVo selectOneProductInfo(@Param("id") Long id, @Param("shopId") Long shopId);
|
||||
|
||||
List<Product> selectCouponProBySaleNum();
|
||||
List<RecommendProVO> selectCouponProBySaleNum();
|
||||
|
||||
void updateProductStockNum(@Param("id") Long id, @Param("shopId") Long shopId, @Param("type") String type, @Param("num") BigDecimal num);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class HomePageServiceImpl implements HomePageService {
|
|||
homeUpVO.setFreeBannerList(bannerVoRandom());
|
||||
|
||||
// 销量榜
|
||||
List<Product> productList = productMapper.selectCouponProBySaleNum();
|
||||
List<RecommendProVO> productList = productMapper.selectCouponProBySaleNum();
|
||||
HotRankingVO hotRankingVO = new HotRankingVO();
|
||||
hotRankingVO.setHotList(productList);
|
||||
homeUpVO.setHotRanking(hotRankingVO);
|
||||
|
|
|
|||
|
|
@ -152,13 +152,15 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCouponProBySaleNum" resultType="com.czg.product.entity.Product">
|
||||
SELECT a.*
|
||||
<select id="selectCouponProBySaleNum" resultType="com.czg.product.vo.RecommendProVO">
|
||||
SELECT a.name, b.origin_price, b.sale_price, a.cover_img, a.id,
|
||||
b.real_sales_number saleNum, round(b.sale_price / b.origin_price, 2) discount
|
||||
FROM tb_product AS a
|
||||
LEFT JOIN tb_prod_sku AS b ON a.id = b.product_id
|
||||
WHERE a.type = 'coupon'
|
||||
ORDER BY b.real_sales_number
|
||||
LIMIT 2
|
||||
|
||||
</select>
|
||||
<select id="selectRecommendProductList" resultType="com.czg.product.vo.RecommendProVO">
|
||||
select ROUND(
|
||||
|
|
|
|||
Loading…
Reference in New Issue