Przeglądaj źródła

修改没加入家族也能查询好友圈数据,允许familyId为空

Alex 4 lat temu
rodzic
commit
0a4761e001

+ 3 - 3
ruoyi-app/src/main/java/com/ruoyi/app/controller/MyPublishController.java

@@ -56,9 +56,9 @@ public class MyPublishController extends AppBaseController {
     @ApiOperation("族友圈 分页列表")
     @GetMapping("/selectCircle")
     public TableDataInfo selectCircle(Long familyId){
-        if (familyId == null) {
-            return new TableDataInfo();
-        }
+//        if (familyId == null) {
+//            return new TableDataInfo();
+//        }
         AppMemberVo user = getLoginUser().getUser();
         List<TbMyPublish> list = publishService.selectPublish(user.getUserId(), familyId);
         return getDataTable(list);

+ 2 - 0
ruoyi-system/src/main/resources/mapper/app/TbMyPublishMapper.xml

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     union all
                     select g.friends_user_id uid from tb_my_friends g  where app_user_id = #{appUserId} and status = 2
                 )
+                <if test="familyId != null and familyId != '' ">
                 union
                 select * from tb_my_publish p
                 where deleted = 'N' and app_user_id in (
@@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     left join tb_member_middle mi on m.id = mi.member_id
                     where family_id = #{familyId} and deleted = 'N' and mi.status = 2
                 )
+                </if>
             ) a
         ) b
     </select>