zhijiezhao 3 yıl önce
ebeveyn
işleme
65f6518120

+ 2 - 0
src/main/java/com/caimei/modules/supervip/dao/CmSvipHistoryDao.java

@@ -25,4 +25,6 @@ public interface CmSvipHistoryDao extends CrudDao<CmSvipHistory> {
     CmSvipHistory findOutEndTime(Long userId);
 
     Integer findPackage(Integer pac);
+
+    Integer findDuration(Integer packageId);
 }

+ 11 - 0
src/main/java/com/caimei/modules/supervip/service/CmSvipHistoryService.java

@@ -44,6 +44,17 @@ public class CmSvipHistoryService extends CrudService<CmSvipHistoryDao, CmSvipHi
         List<CmSvipHistory> history = svipDao.findHistory(cmSvipHistory);
         //1生效2过期3未生效
         for (CmSvipHistory svipHistory : history) {
+            Integer packageID = svipHistory.getPackageId();
+            Integer duration=svipDao.findDuration(packageID);
+            if(duration.equals(3)){
+                svipHistory.setPackageId(3);
+            }
+            if(duration.equals(1)){
+                svipHistory.setPackageId(1);
+            }
+            if(duration.equals(12)){
+                svipHistory.setPackageId(12);
+            }
             Date beginTime = svipHistory.getBeginTime();
             Date endTime = svipHistory.getEndTime();
             //开始时间<现在

+ 8 - 0
src/main/resources/mappings/modules/super/CmSvipHistoryMapper.xml

@@ -94,6 +94,7 @@
         LEFT JOIN club cb ON cs.userId = cb.userId
         left join user u on cs.userId = u.userID
         where cs.userId = #{userId}
+        AND cs.payStatus = '1'
         <if test="startPayTime != null and startPayTime != '' and endPayTime != null and endPayTime != ''">
             and (payTime between #{startPayTime} and #{endPayTime})
         </if>
@@ -130,6 +131,7 @@
         LEFT JOIN cm_svip_user cu ON cs.userId = cu.userId
         left join user u on cs.userId = u.userID
         <where>
+            AND cs.payStatus = '1'
             <if test="clubName != null and clubName != ''">
                 and u.name like concat('%',#{clubName},'%')
             </if>
@@ -171,4 +173,10 @@
         where duration = #{pac}
     </select>
 
+    <select id="findDuration" resultType="java.lang.Integer">
+        select duration
+        from cm_svip_package
+        where id = #{packageId}
+    </select>
+
 </mapper>