mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-23 03:22:17 +08:00
Merge pull request #174 from aaayun/fixbug-csv-export-update
解决导出csv列数据错位问题
This commit is contained in:
commit
9fcdac7e41
@ -34,19 +34,24 @@ class PackageMsg:
|
|||||||
for row in messages:
|
for row in messages:
|
||||||
row_list = list(row)
|
row_list = list(row)
|
||||||
# 删除不使用的几个字段
|
# 删除不使用的几个字段
|
||||||
|
del row_list[13]
|
||||||
del row_list[12]
|
del row_list[12]
|
||||||
del row_list[11]
|
del row_list[11]
|
||||||
del row_list[10]
|
del row_list[10]
|
||||||
|
del row_list[9]
|
||||||
|
|
||||||
strtalker = row[11]
|
strtalker = row[11]
|
||||||
info = micro_msg_db.get_contact_by_username(strtalker)
|
info = micro_msg_db.get_contact_by_username(strtalker)
|
||||||
if info is not None:
|
if info is not None:
|
||||||
row_list.append(info[3])
|
row_list.append(info[3])
|
||||||
row_list.append(info[4])
|
row_list.append(info[4])
|
||||||
|
else:
|
||||||
|
row_list.append('')
|
||||||
|
row_list.append('')
|
||||||
# 判断是否是群聊
|
# 判断是否是群聊
|
||||||
if strtalker.__contains__('@chatroom'):
|
if strtalker.__contains__('@chatroom'):
|
||||||
# 自己发送
|
# 自己发送
|
||||||
if row[12] == 1:
|
if row[4] == 1:
|
||||||
row_list.append('我')
|
row_list.append('我')
|
||||||
else:
|
else:
|
||||||
# 存在BytesExtra为空的情况,此时消息类型应该为提示性消息。跳过不处理
|
# 存在BytesExtra为空的情况,此时消息类型应该为提示性消息。跳过不处理
|
||||||
@ -75,6 +80,14 @@ class PackageMsg:
|
|||||||
sender = senderinfo[3]
|
sender = senderinfo[3]
|
||||||
membersMap[wxid] = senderinfo[3]
|
membersMap[wxid] = senderinfo[3]
|
||||||
row_list.append(sender)
|
row_list.append(sender)
|
||||||
|
else:
|
||||||
|
if row[4] == 1:
|
||||||
|
row_list.append('我')
|
||||||
|
else:
|
||||||
|
if info is not None:
|
||||||
|
row_list.append(info[4])
|
||||||
|
else:
|
||||||
|
row_list.append('')
|
||||||
updated_messages.append(tuple(row_list))
|
updated_messages.append(tuple(row_list))
|
||||||
return updated_messages
|
return updated_messages
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user