|
|
@@ -42,6 +42,8 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
|
|
|
|
|
|
private final StoreMenuMapper storeMenuMapper;
|
|
|
|
|
|
+ private final LifeCollectMapper lifeCollectMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public boolean saveThali(LifeGroupBuyDto lifeGroupBuyDto) {
|
|
|
JSONObject currentUserInfo = JwtUtil.getCurrentUserInfo();
|
|
|
@@ -99,12 +101,18 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public LifeGroupBuyThaliVo getThaliById(String id) {
|
|
|
+ public LifeGroupBuyThaliVo getThaliById(String id, String userId) {
|
|
|
LifeGroupBuyMain lifeGroupBuyMain = lifeGroupBuyMainMapper.selectById(id);
|
|
|
LifeGroupBuyThaliVo lifeGroupBuyThaliVo = new LifeGroupBuyThaliVo();
|
|
|
BeanUtils.copyProperties(lifeGroupBuyMain, lifeGroupBuyThaliVo);
|
|
|
List<LifeGroupBuyThali> lifeGroupBuyThalis = lifeGroupBuyThaliMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyThali>().eq(LifeGroupBuyThali::getParentId, id).eq(LifeGroupBuyThali::getDeleteFlag, 0));
|
|
|
|
|
|
+ // 是否收藏了该团购
|
|
|
+ LifeCollect lifeCollect = lifeCollectMapper.selectOne(new QueryWrapper<LifeCollect>().eq("user_id", userId).eq("coupon_id", id));
|
|
|
+ lifeGroupBuyThaliVo.setIsCollect("0");
|
|
|
+ if(!Objects.isNull(lifeCollect)){
|
|
|
+ lifeGroupBuyThaliVo.setIsCollect("1");
|
|
|
+ }
|
|
|
//美食
|
|
|
if (lifeGroupBuyMain.getGroupType() == 1) {
|
|
|
for (LifeGroupBuyThali lifeGroupBuyThali : lifeGroupBuyThalis) {
|