Skip to content
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

fix:修复值为0、'0'的参数会被过滤的问题 #2864

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

Viminice
Copy link
Contributor

@Viminice Viminice commented Dec 4, 2024

v2版本有一些行业内接口,是需要传0的

Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
easywechat ❌ Failed (Inspect) Dec 4, 2024 10:21am

@@ -38,7 +38,9 @@ public function sign(array $params): array
'sub_appid' => $params['sub_appid'] ?? null,
],
$params
)
), function ($value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议函数用 static fn ($value, $key) => !($key === 'sign' || $value === '' || is_null($value)) 一行搞定,要点是 static 会有一点点性能优势,$key 排除掉 sign

@TheNorthMemory
Copy link
Contributor

直白地说,在企业微信的4个接口里,agentid 有可能是字符串'0',这是不是就是你说的「行业内接口」?

@Viminice
Copy link
Contributor Author

Viminice commented Dec 4, 2024

比如医疗行业,有移动医保支付接口,会涉及到统筹金额、个账金额、现金金额这些,比如走纯自费,那么医保金额这些金额就是0

@Viminice
Copy link
Contributor Author

Viminice commented Dec 4, 2024

这个框架是非常好用的,可以直接对接这些非开放的接口,目前就是由于会自动去掉这些传0的字段导致出问题

@TheNorthMemory
Copy link
Contributor

比如医疗行业,有移动医保支付接口,会涉及到统筹金额、个账金额、现金金额这些,比如走纯自费,那么医保金额这些金额就是0

我记得「医保混合支付」功能是定制化的APIv3协议,跟普通的协议有所区别,看样子你这个是走的APIv2协议咯?

@Viminice
Copy link
Contributor Author

Viminice commented Dec 4, 2024

可能每个省份不一样,我这边还是v2的

@overtrue overtrue merged commit 3be0db1 into w7corp:6.x Dec 4, 2024
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants