|
@@ -208,6 +208,7 @@ public class CpsPopularizeController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/all/goods")
|
|
@GetMapping("/get/all/goods")
|
|
|
public Result<List<GoodsDon>> getAllGoodsList(Boolean isNoBuyout, Boolean isRate) {
|
|
public Result<List<GoodsDon>> getAllGoodsList(Boolean isNoBuyout, Boolean isRate) {
|
|
|
|
|
+ Long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
|
|
|
MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
//过滤买断制 平台
|
|
//过滤买断制 平台
|
|
|
String conditionSql;
|
|
String conditionSql;
|
|
@@ -219,7 +220,11 @@ public class CpsPopularizeController {
|
|
|
}
|
|
}
|
|
|
conditionSql += " and exists (select id from goods_don_sku sku where sku.goods_id = g.id limit 1)";
|
|
conditionSql += " and exists (select id from goods_don_sku sku where sku.goods_id = g.id limit 1)";
|
|
|
if (isRate != null && isRate) {
|
|
if (isRate != null && isRate) {
|
|
|
- conditionSql += " and exists (select 1 from user_plat_distribute_rate upr where upr.goods_id = g.id and upr.rate > 0)";
|
|
|
|
|
|
|
+ UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
|
|
|
|
|
+ .eq(UserDistribute::getUserId, cpsUserId)
|
|
|
|
|
+ .eq(UserDistribute::getDeleted, 1)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ conditionSql += String.format(" and exists (select 1 from user_plat_distribute_rate upr where upr.distribute_id = %s and upr.goods_id = g.id and upr.rate > 0)", userDistribute.getId());
|
|
|
}
|
|
}
|
|
|
List<GoodsDon> goodsDons = beanSearcher.searchAll(GoodsDon.class, mapBuilder
|
|
List<GoodsDon> goodsDons = beanSearcher.searchAll(GoodsDon.class, mapBuilder
|
|
|
.put("condition", conditionSql)
|
|
.put("condition", conditionSql)
|