Browse Source

修复官网老师端专辑收藏

Eric 2 năm trước cách đây
mục cha
commit
f23ce83809

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/AlbumFavoriteService.java

@@ -29,7 +29,8 @@ public interface AlbumFavoriteService extends IService<AlbumFavorite> {
      *
      * @param userId 用户id
      * @param albumIds 专辑id
+     * @param clientType ClientEnum
      * @return
      */
-    List<Long> selectFavorite(Long userId, List<Long> albumIds);
+    List<Long> selectFavorite(Long userId, List<Long> albumIds, ClientEnum clientType);
 }

+ 6 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/AlbumFavoriteServiceImpl.java

@@ -44,11 +44,13 @@ public class AlbumFavoriteServiceImpl extends ServiceImpl<AlbumFavoriteDao,Album
     }
 
     @Override
-    public List<Long> selectFavorite(Long userId, List<Long> albumIds) {
+    public List<Long> selectFavorite(Long userId, List<Long> albumIds, ClientEnum clientType) {
+
         List<AlbumFavorite> list = this.lambdaQuery()
-                                       .in(AlbumFavorite::getAlbumId, albumIds)
-                                       .eq(AlbumFavorite::getUserId, userId)
-                                       .list();
+                .in(AlbumFavorite::getAlbumId, albumIds)
+                .eq(AlbumFavorite::getUserId, userId)
+                .eq(AlbumFavorite::getClientType, clientType)
+                .list();
 
         if (CollectionUtils.isEmpty(list)) {
             return new ArrayList<>();

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicAlbumServiceImpl.java

@@ -223,7 +223,7 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
         if (query.getUserId() == null || CollectionUtils.isEmpty(albumIds)) {
             return iPage;
         }
-        albumIds = albumFavoriteService.selectFavorite(query.getUserId(),albumIds);
+        albumIds = albumFavoriteService.selectFavorite(query.getUserId(), albumIds, clientType);
         for (MusicAlbumVo record : records) {
             if(albumIds.contains(record.getId())) {
                 record.setFavorite(YesOrNoEnum.YES);

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -134,7 +134,7 @@
             and t.source_type_ = #{param.sourceType}
         </if>
         <if test="param.chargeType != null">
-            and t.charge_type_ = #{param.chargeType}
+            and (t.charge_type_ = #{param.chargeType} OR FIND_IN_SET(#{param.chargeType}, t.payment_type_))
         </if>
         <if test="param.topFlag != null">
             and t.top_flag_ = #{param.topFlag}