BUGFIX: 查询affiliate时,不显示已删除的记录,删除affiliate时,状态也修改

This commit is contained in:
2025-11-22 00:41:35 +08:00
parent 97c5be7b22
commit 059d6edc12
2 changed files with 7 additions and 4 deletions

View File

@@ -212,10 +212,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
if (!StringUtil.isNullOrEmpty(operationType)) {
if (operationType.equals("Delete")) {
baseMapper.deleteById(id);
return;
} else if (operationType.equals("Active") || operationType.equals("Inactive")) {
if (operationType.equals("Delete") || operationType.equals("Active") || operationType.equals("Inactive")) {
affiliate.setStatus(operationType);
} else {
throw new BusinessException("unknown.operationType");
@@ -223,6 +220,10 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
}
affiliate.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(affiliate);
if (operationType.equals("Delete")) {
baseMapper.deleteById(id);
}
}
// 定时计算佣金

View File

@@ -37,6 +37,7 @@
<if test="affiliateId != null">
AND f.id = #{affiliateId}
</if>
AND f.is_deleted = 0
</where>
<choose>
<when test="sortField != null and sortField != ''">
@@ -83,6 +84,7 @@
AND f.id = #{affiliateId}
</if>
</where>
AND f.is_deleted = 0
</select>
<select id="selectAllAffiliateUsername" resultType="java.util.Map">