Browse Source

add:机构端老师增加专辑会员

yonge 1 week ago
parent
commit
9302af3eb3

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantGroupAlbumServiceImpl.java

@@ -190,13 +190,13 @@ public class TenantGroupAlbumServiceImpl extends ServiceImpl<TenantGroupAlbumMap
         }
 
         // 如果学生购买 判断购买次数
-        if (query.getClientType() == ClientEnum.STUDENT) {
+        if (query.getClientType() == ClientEnum.STUDENT || query.getClientType() == ClientEnum.TEACHER) {
             // 曲目ID集合
             List<Long> tenantGroupAlbumIds = buyAlbumInfo.stream().map(TenantGroupAlbumWrapper.BuyTenantAlbum::getTenantGroupAlbumId).collect(Collectors.toList());
             List<Long> studentTenantAlbumNum = userOrderDao.getStudentTenantAlbumNum(query.getUserId(), tenantGroupAlbumIds);
 
             // 判断是否还在生效中
-            List<UserTenantAlbumRecord> albumRecordList = userTenantAlbumRecordService.getUseAlbumByUserId(query.getUserId(), ClientEnum.STUDENT);
+            List<UserTenantAlbumRecord> albumRecordList = userTenantAlbumRecordService.getUseAlbumByUserId(query.getUserId(), query.getClientType());
             Map<Long,UserTenantAlbumRecord> albumRecordMap = new HashMap<>();
             // 转map
             if (CollectionUtils.isNotEmpty(albumRecordList)) {

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

@@ -422,7 +422,7 @@
         union
         select if(count(1)>0,'DISCOUNT','') from discount_card_record where user_id_ = #{userId} and efficient_flag_ = 1 and client_type_ = 'STUDENT' and end_time_ > now() and deduction_status_ = 'EFFECTIVE'
         union
-        select if(count(1)>0,'TENANT_ALBUM','') from user_tenant_album_record where user_id_ = #{userId} and efficient_flag_ = 1  and end_time_ > now() and deduction_status_ = 'EFFECTIVE'
+        select if(count(1)>0,'TENANT_ALBUM','') from user_tenant_album_record where user_id_ = #{userId} and efficient_flag_ = 1 and client_type_ = 'STUDENT'  and end_time_ > now() and deduction_status_ = 'EFFECTIVE'
 
     </select>