修复足迹不能删除的问题

This commit is contained in:
hupeng
2020-09-17 11:39:43 +08:00
parent b88e515ef4
commit 9291c18329
5 changed files with 6 additions and 6 deletions

View File

@ -25,5 +25,5 @@ public class YxStoreProductRelationQueryParam {
private String id;
@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
private String category;
private String category = "root";
}

View File

@ -251,7 +251,7 @@ public class StoreProductController {
throw new YshopException("参数非法");
}
productRelationService.delRroductRelation(Long.valueOf(param.getId()),
uid);
uid,param.getCategory());
return ApiResult.ok();
}

View File

@ -50,7 +50,7 @@ public interface YxStoreProductRelationService extends BaseService<YxStoreProduc
* @param productId 商品id
* @param uid 用户id
*/
void delRroductRelation(long productId,long uid);
void delRroductRelation(long productId,long uid,String category);
/**
* 获取用户收藏列表

View File

@ -96,11 +96,11 @@ public class YxStoreProductRelationServiceImpl extends BaseServiceImpl<YxStorePr
* @param uid 用户id
*/
@Override
public void delRroductRelation(long productId,long uid) {
public void delRroductRelation(long productId,long uid,String category) {
YxStoreProductRelation productRelation = this.lambdaQuery()
.eq(YxStoreProductRelation::getProductId,productId)
.eq(YxStoreProductRelation::getUid,uid)
.eq(YxStoreProductRelation::getType,"collect")
.eq(YxStoreProductRelation::getType,category)
.one();
if(productRelation == null) {
throw new YshopException("已取消");

View File

@ -30,7 +30,7 @@ import java.util.List;
@Repository
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" +
" 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")