-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
企业微信审批结果消息通知无法解析XML #2592
Comments
问题已解决: #2593 |
|
|
使用 easywechat/src/Kernel/Support/Xml.php Lines 90 to 100 in a3733f3
对应地,可以看看下面这段代码: 解析出来能达预期,如文档上示例解析如下: array(7) {
["ToUserName"]=>
string(18) "ww1cSD21f1e9c0caaa"
["FromUserName"]=>
string(3) "sys"
["CreateTime"]=>
string(10) "1571732272"
["MsgType"]=>
string(5) "event"
["Event"]=>
string(19) "sys_approval_change"
["AgentID"]=>
string(7) "3010040"
["ApprovalInfo"]=>
array(10) {
["SpNo"]=>
string(12) "201910220003"
["SpName"]=>
string(12) "示例模板"
["SpStatus"]=>
string(1) "1"
["TemplateId"]=>
string(43) "3TkaH5KFbrG9heEQWLJjhgpFwmqAFB4dLEnapaB7aaa"
["ApplyTime"]=>
string(10) "1571728713"
["Applyer"]=>
array(2) {
["UserId"]=>
string(8) "WuJunJie"
["Party"]=>
string(1) "1"
}
["SpRecord"]=>
array(2) {
[0]=>
array(3) {
["SpStatus"]=>
string(1) "1"
["ApproverAttr"]=>
string(1) "2"
["Details"]=>
array(2) {
[0]=>
array(4) {
["Approver"]=>
array(1) {
["UserId"]=>
string(12) "WangXiaoMing"
}
["Speech"]=>
string(0) ""
["SpStatus"]=>
string(1) "1"
["SpTime"]=>
string(1) "0"
}
[1]=>
array(4) {
["Approver"]=>
array(1) {
["UserId"]=>
string(13) "XiaoGangHuang"
}
["Speech"]=>
string(0) ""
["SpStatus"]=>
string(1) "1"
["SpTime"]=>
string(1) "0"
}
}
}
[1]=>
array(3) {
["SpStatus"]=>
string(1) "1"
["ApproverAttr"]=>
string(1) "1"
["Details"]=>
array(4) {
["Approver"]=>
array(1) {
["UserId"]=>
string(11) "XiaoHongLiu"
}
["Speech"]=>
string(0) ""
["SpStatus"]=>
string(1) "1"
["SpTime"]=>
string(1) "0"
}
}
}
["Notifyer"]=>
array(1) {
["UserId"]=>
string(10) "ChengLiang"
}
["Comments"]=>
array(4) {
["CommentUserInfo"]=>
array(1) {
["UserId"]=>
string(6) "LiuZhi"
}
["CommentTime"]=>
string(10) "1571732272"
["CommentContent"]=>
string(18) "这是一个备注"
["CommentId"]=>
string(19) "6750538708562308220"
}
["StatuChangeEvent"]=>
string(2) "10"
}
} |
@TheNorthMemory 把这个代码抽个包出来吧,我来用你的 |
行嘛,周末我捋一下 |
大佬们V5 |
|
Nice 👍🏼 |
我用的环境
业务流程
企业微信自建应用,业务流程发起审批单,用户在审批单审批后,企业微信发起消息通知到自建应用api接口;
代码:
问题
无法解析出
$message->ApprovalInfo['SpRecord']
字段,查看传过来的消息原始数据是有内容的,但SpRecord解析不出来,部分字段解析成SimpleXMLElement
返回示例:
The text was updated successfully, but these errors were encountered: