修复足迹不能删除的问题
This commit is contained in:
@ -25,5 +25,5 @@ public class YxStoreProductRelationQueryParam {
|
|||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
|
@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
|
||||||
private String category;
|
private String category = "root";
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ public class StoreProductController {
|
|||||||
throw new YshopException("参数非法");
|
throw new YshopException("参数非法");
|
||||||
}
|
}
|
||||||
productRelationService.delRroductRelation(Long.valueOf(param.getId()),
|
productRelationService.delRroductRelation(Long.valueOf(param.getId()),
|
||||||
uid);
|
uid,param.getCategory());
|
||||||
return ApiResult.ok();
|
return ApiResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public interface YxStoreProductRelationService extends BaseService<YxStoreProduc
|
|||||||
* @param productId 商品id
|
* @param productId 商品id
|
||||||
* @param uid 用户id
|
* @param uid 用户id
|
||||||
*/
|
*/
|
||||||
void delRroductRelation(long productId,long uid);
|
void delRroductRelation(long productId,long uid,String category);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户收藏列表
|
* 获取用户收藏列表
|
||||||
|
@ -96,11 +96,11 @@ public class YxStoreProductRelationServiceImpl extends BaseServiceImpl<YxStorePr
|
|||||||
* @param uid 用户id
|
* @param uid 用户id
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void delRroductRelation(long productId,long uid) {
|
public void delRroductRelation(long productId,long uid,String category) {
|
||||||
YxStoreProductRelation productRelation = this.lambdaQuery()
|
YxStoreProductRelation productRelation = this.lambdaQuery()
|
||||||
.eq(YxStoreProductRelation::getProductId,productId)
|
.eq(YxStoreProductRelation::getProductId,productId)
|
||||||
.eq(YxStoreProductRelation::getUid,uid)
|
.eq(YxStoreProductRelation::getUid,uid)
|
||||||
.eq(YxStoreProductRelation::getType,"collect")
|
.eq(YxStoreProductRelation::getType,category)
|
||||||
.one();
|
.one();
|
||||||
if(productRelation == null) {
|
if(productRelation == null) {
|
||||||
throw new YshopException("已取消");
|
throw new YshopException("已取消");
|
||||||
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface YxStoreProductRelationMapper extends CoreMapper<YxStoreProductRelation> {
|
public interface YxStoreProductRelationMapper extends CoreMapper<YxStoreProductRelation> {
|
||||||
|
|
||||||
@Select("select B.id pid,A.category,B.store_name as storeName,B.price," +
|
@Select("select B.id pid,A.type as category,B.store_name as storeName,B.price," +
|
||||||
"B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow" +
|
"B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow" +
|
||||||
" from yx_store_product_relation A left join yx_store_product B " +
|
" from yx_store_product_relation A left join yx_store_product B " +
|
||||||
"on A.product_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
|
"on A.product_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
|
||||||
|
Reference in New Issue
Block a user