admin
2020-06-10 271ae63c20fcbe28d29c47f1881138ff6551a2a1
fanli/src/main/java/com/yeshi/fanli/dao/user/invite/TeamFansInfoDao.java
@@ -90,7 +90,7 @@
   public List<TeamFansInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) {
      Query query = createQuery(type, uid, focusDTO);
      query.skip(start).limit(count);
      query.with(new Sort(Sort.Direction.DESC, "weight"));
      query.with(new Sort(Sort.Direction.DESC, "joinTime"));
      return findList(query);
   }
@@ -213,4 +213,34 @@
      return query;
   }
   /**
    * 根据用户信息匹配
    * @param key
    * @return
    */
   public List<TeamFansInfo> queryByUserInfo(String key) {
      if (StringUtil.isNullOrEmpty(key))
         return null;
      Long workerId = null;
      try {
         workerId = Long.parseLong(key);
      } catch (Exception e) {
      }
      Criteria criteria = null;
      if (workerId == null) {
         criteria = new Criteria().orOperator(Criteria.where("phone").is(key),
               new Criteria().orOperator(Criteria.where("inviteCode").is(key)));
      } else {
         criteria = new Criteria().orOperator(Criteria.where("phone").is(key),
               new Criteria().orOperator(Criteria.where("inviteCode").is(key)),
               new Criteria().orOperator(Criteria.where("workerId").is(workerId)));
      }
      Query query = new Query(criteria);
      return findList(query);
   }
}