-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 拼团记录,虚拟成团数有误 #720
base: master
Are you sure you want to change the base?
fix: 拼团记录,虚拟成团数有误 #720
Changes from 1 commit
bed08f0
f063914
dc0e3d9
e8f5d0b
cbdc275
f8e388b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,7 +252,19 @@ public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long | |
|
||
@Override | ||
public Long getCombinationRecordCount(@Nullable Integer status, @Nullable Boolean virtualGroup, @Nullable Long headId) { | ||
return combinationRecordMapper.selectCountByHeadAndStatusAndVirtualGroup(status, virtualGroup, headId); | ||
// virtualGroup 为 null,或者为 false 的时候,走原流程 | ||
if (virtualGroup == null || !virtualGroup) { | ||
return combinationRecordMapper.selectCountByHeadAndStatusAndVirtualGroup(status, virtualGroup, headId); | ||
} | ||
|
||
// virtualGroup 为 true 的时候,查询虚拟成团的数量 | ||
List<CombinationActivityDO> activities = combinationActivityService.getByVirtualGroup(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个,是不是只查询数量?不要返回 list 去求 count There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的主要目的是查activityIds |
||
if (CollUtil.isEmpty(activities)) { | ||
return 0L; | ||
} | ||
|
||
List<Long> activityIds = convertList(activities, CombinationActivityDO::getId); | ||
return combinationRecordMapper.selectCountByHeadAndStatusAndActivityIds(activityIds, status, headId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是不是不用 activityIds 过滤??? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 需要activityIds过滤。从数据上看,虚拟成团(virtual_group)在 promotion_combination_record ,真实用户记 true。虚拟用户记 false。导致只能依靠activityIds筛选出虚拟成团的数据。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是不是不拿 activityIds 过滤,直接通过 “真实用户记 true。虚拟用户记 false”,也可以呀? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有个疑问:在拼团活动支持虚拟成团的情况下,一个队伍(全是真实用户),一个队伍(存在虚拟用户),那么在统计页面【拼团记录——虚拟成团(个)】预期是2 还是1? |
||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体查询,建议放到 mapper 里。
service 不要有 dao 操作
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好