|
@@ -273,8 +273,11 @@ class MySQLUserManager(UserManager):
|
|
sql = f"""
|
|
sql = f"""
|
|
SELECT a.third_party_user_id, b.tag_id, b.name FROM qywx_user_tag a
|
|
SELECT a.third_party_user_id, b.tag_id, b.name FROM qywx_user_tag a
|
|
JOIN qywx_tag b ON a.tag_id = b.tag_id
|
|
JOIN qywx_tag b ON a.tag_id = b.tag_id
|
|
- AND a.third_party_user_id IN {str(tuple(batch_user_ids))}
|
|
|
|
"""
|
|
"""
|
|
|
|
+ if len(batch_user_ids) == 1:
|
|
|
|
+ sql += f" AND a.third_party_user_id = '{batch_user_ids[0]}'"""
|
|
|
|
+ else:
|
|
|
|
+ sql += f" AND a.third_party_user_id IN {str(tuple(batch_user_ids))}"
|
|
rows = self.db.select(sql, pymysql.cursors.DictCursor)
|
|
rows = self.db.select(sql, pymysql.cursors.DictCursor)
|
|
# group by user_id
|
|
# group by user_id
|
|
for row in rows:
|
|
for row in rows:
|