From a18a6584344f3195859704d81245846ae21de7f7 Mon Sep 17 00:00:00 2001 From: xuecong <> Date: Sun, 21 Nov 2021 11:47:29 +0800 Subject: [PATCH] fix access card list --- server/src/module/mp/controller/access/list.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/module/mp/controller/access/list.ts b/server/src/module/mp/controller/access/list.ts index 728deea..4010ebb 100644 --- a/server/src/module/mp/controller/access/list.ts +++ b/server/src/module/mp/controller/access/list.ts @@ -13,6 +13,7 @@ import { Action } from '~/types/action'; import { SUCCESS } from '~/constant/code'; import utils from '~/utils'; +import { BINDING_BUILDING } from '~/constant/status'; import { SELF_ACCESS_CODE } from '~/constant/enter_access'; interface RequestBody { @@ -50,6 +51,8 @@ const MpAccessListAction = { .leftJoin('ejyy_building_info', 'ejyy_building_info.id', 'ejyy_user_building.building_id') .where('ejyy_building_info.community_id', community_id) .whereIn('ejyy_user_building.building_id', building_ids) + .andWhere('ejyy_user_building.wechat_mp_user_id', ctx.mpUserInfo.id) + .andWhere('ejyy_user_building.status', BINDING_BUILDING) .select('ejyy_user_building.building_id') .orderBy('ejyy_user_building.id', 'desc');