|
@@ -188,7 +188,7 @@ class MySQLUserRelationManager(UserRelationManager):
|
|
|
logging.warning(f"staff[{wxid}] has no user")
|
|
|
continue
|
|
|
user_ids = tuple(user['user_id'] for user in user_data)
|
|
|
- sql = f"SELECT union_id FROM {self.user_table} WHERE id IN {str(user_ids)}"
|
|
|
+ sql = f"SELECT union_id FROM {self.user_table} WHERE id IN {str(user_ids)} AND union_id is not null"
|
|
|
user_data = self.wecom_db.select(sql, pymysql.cursors.DictCursor)
|
|
|
if not user_data:
|
|
|
logging.error(f"staff[{wxid}] users not found in wecom database")
|