Browse Source

我关注的专家、顾问BUG修复

anderx 7 years ago
parent
commit
60fb2b91d2

+ 2 - 7
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -812,7 +812,7 @@ public class AppUserController extends CertifyApiController {
 		return res;
 	}
 	/*
-	 * 关注列表 -专家
+	 * 关注列表 -专家 顾问
 	 * */
 	@RequestMapping(value="/appMyInterested",method=RequestMethod.GET)
 	public Result appMyInterested(Integer type,Integer pageNo,Integer pageSize) {
@@ -821,12 +821,7 @@ public class AppUserController extends CertifyApiController {
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
-		if (type==0) {
-			result.setData(userIdentityService.appMyInterestedExpert(pageNo,pageSize));
-		}else if(type==1){
-			return null;
-		}
-		//result.setData(userIdentityService.listInterestedExpert(pageNo,pageSize));
+			result.setData(userIdentityService.appMyInterestedExpert(type,pageNo,pageSize));
 		return result;
 	}
 	

+ 17 - 3
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -1203,8 +1203,15 @@ order by
 	from user_identity t left JOIN `user` u on t.uid = u.id
 	left join user_interest ui on ui.to_uid=u.id
 	left join (select to_uid,count(*) as count from user_interest 
-		order by to_uid) a on ui.to_uid=u.id
-	where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
+		GROUP  by to_uid) a on ui.to_uid=u.id
+	where 1=1
+	<if test="type==0">
+	and t.expert=1 
+	</if>
+	<if test="type==1">
+	and t.expert=2 
+	</if>
+	and ui.from_uid=#{uid,jdbcType=VARCHAR}
 	<if test="page_sql!=null">
         ${page_sql}
     </if>
@@ -1213,7 +1220,14 @@ order by
 	 	select count(0)
 		from user_identity t left JOIN user u on t.uid = u.id
 		left join user_interest ui on ui.to_uid=u.id
-		where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
+		where 1=1
+	<if test="type==0">
+	and t.expert=1 
+	</if>
+	<if test="type==1">
+	and t.expert=2 
+	</if>
+	and ui.from_uid=#{uid,jdbcType=VARCHAR}
 </select>
 <select id="selectCustomerAuditList" resultType="com.goafanti.app.bo.ExpertsListBo">
 	select u.id as uid, u.nickname as username, u.head_portrait_url as personPortraitUrl,

+ 1 - 1
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -72,7 +72,7 @@ public interface UserIdentityService {
 
 	Pagination<UserIdentityBo>listInterestedExpert(Integer pageNo,Integer pageSize);
 
-	Pagination<MyInterestedBo> appMyInterestedExpert(Integer pageNo, Integer pageSize);
+	Pagination<MyInterestedBo> appMyInterestedExpert(Integer type,Integer pageNo, Integer pageSize);
 	
 	Pagination<MyInterestedBo> getExpertAuditList(InputUserIdentity identity,Integer pageNo, Integer pageSize);
 	

+ 2 - 1
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -488,11 +488,12 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<MyInterestedBo> appMyInterestedExpert(Integer pageNo, Integer pageSize) {
+	public Pagination<MyInterestedBo> appMyInterestedExpert(Integer type,Integer pageNo, Integer pageSize) {
 		if(pageNo==null || pageNo<1)pageNo=1;
 		if(pageSize==null ||pageSize<1)pageSize=10; 
 		 Map<String, Object> params=new HashMap<String,Object>();
 		 params.put("uid", TokenManager.getUserId());
+		 params.put("type", type);
 //		 params.put("uid", "1180fa62-7c42-44be-bc41-5583814d69f4");
 		return (Pagination<MyInterestedBo>) findPage("appMyInterestedExpertList", "appMyInterestedExpertCount", params, pageNo, pageSize);
 	}