Commit 86d7af4d by guanchen

失效代理商不再参与分钱

parent f7f3b1fe
......@@ -47,7 +47,7 @@ public class UserAgentSqlProvider {
"b.agent_level_four " +
"FROM user_agent a " +
"JOIN user_agent b on a." + parentColumnName + "=b.agent_id " +
"WHERE a.agent_id=#{agentId} and b.agent_level<=4";
"WHERE a.agent_id=#{agentId} and b.agent_level<=4 and b.agent_state=1";
}
public String getChildListByUserId(@Param("userId") Integer userId, @Param("parentColumnName") String parentColumnName) {
return "SELECT " +
......
......@@ -195,7 +195,7 @@ public class UserServiceImpl implements UserService {
@Override
public UserAgent getUserAgentByUserId(Integer userId) {
QueryWrapper<UserAgent> queryWrapper = new QueryWrapper<UserAgent>();
queryWrapper.eq("user_id", userId).le("agent_level", 4);
queryWrapper.eq("user_id", userId).le("agent_level", 4).eq("agent_state", 1);
return userAgentMapper.selectOne(queryWrapper);
}
......@@ -344,7 +344,6 @@ public class UserServiceImpl implements UserService {
logger.info("loop find parent agent start ......");
}
int loogAgentId = firstAgent.getAgentId();
loopTimes = 0;
while (true) {
ParentAgent loopUserAgent = getParentAgent(loogAgentId, parentColumnName);
if (null == loopUserAgent) {
......@@ -398,16 +397,17 @@ public class UserServiceImpl implements UserService {
if (logger.isInfoEnabled()) {
logger.info("setAgentList {} for user: {} end", parentColumnName, userId);
}
return filterInvalid(agentList);
return agentList;
// return filterInvalid(agentList);
}
private List<ParentAgent> filterInvalid(ArrayList<ParentAgent> agentList) {
List<ParentAgent> resultList = new ArrayList<ParentAgent>();
for (ParentAgent parentAgent : agentList) {
if (parentAgent.getAgentState() == 1) {
resultList.add(parentAgent);
}
}
return resultList;
}
// private List<ParentAgent> filterInvalid(ArrayList<ParentAgent> agentList) {
// List<ParentAgent> resultList = new ArrayList<ParentAgent>();
// for (ParentAgent parentAgent : agentList) {
// if (parentAgent.getAgentState() == 1) {
// resultList.add(parentAgent);
// }
// }
// return resultList;
// }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment