Selaa lähdekoodia

fix 账号过期人数

zoujiajian 3 vuotta sitten
vanhempi
sitoutus
a558cb6e1c

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsMapper.java

@@ -37,4 +37,6 @@ public interface GroupsMapper extends BaseMapper<GroupsTrips> {
 	Long selectSameSpecEmptyGroups(Long skuId);
 
 	Long selectMidJourneySameSpecItemGroups(@Param("groupsId") Long groupsId, @Param("skuId") Long skuId, @Param("expiryTime") Date expiryTime);
+
+	Integer countExpiredNum(Long accountId);
 }

+ 8 - 0
netflix-dao/src/main/resources/mapper/GroupsMapper.xml

@@ -70,4 +70,12 @@
           and gt.available_num > 0
         order by gt.available_num asc limit 1
     </select>
+
+    <select id="countExpiredNum" resultType="java.lang.Integer">
+        select count(ur.id)
+        from user_ticket_cleared_record ur
+        where ur.account_id = #{accountId}
+          and deleted is true
+          and source = 'self'
+    </select>
 </mapper>

+ 2 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -163,6 +163,8 @@ public class CmsAccountController {
 			if (recordList.size() > 0) {
 				accountView.setLastUpdatePwdDate(recordList.get(0).getCreatedTime());
 			}
+			Integer expiryCount = groupsMapper.countExpiredNum(accountView.getId());
+			accountView.setExpiryCount(expiryCount);
 		});
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}