7 Commits

Author SHA1 Message Date
邹景立
d2b499d14a refactor: 使用 BC Math 替换浮点运算以提高精度
将多处基于浮点的数值计算替换为 BC Math 字符串运算以避免浮点精度问题,涉及支付、退款、转账、比较与统计逻辑的重构。主要改动包括:

- 将比较与判断替换为 bccomp,累加与合并使用 bcadd,乘以 100 等使用 bcmul;
- 将部分初始数值与统计结果从数值类型改为字符串形式(如 '0.00'),并调整相关返回类型(如 Payment::paidAmount 改为返回 string);
- 修正订单/退款金额计算与超额校验逻辑以使用高精度算术;
- 更新微信支付相关 SDK 调用中金额乘 100 的计算以避免精度误差;
- 在若干插件中用高精度运算替换 floatval/int 转换(包括 SystemQueue、Wemall、Wuma 等);
- 更新文档(readme)添加 BC Math/高精度计算等说明并统一版权年份至 2014-2026;
- 新增 .copilot-commit-message-instructions.md(提交信息规范)。

此改动旨在增强金融/金额相关业务的计算正确性与一致性,避免因浮点运算导致的金额误差。
2026-02-01 13:27:10 +08:00
邹景立
6b3e985747 fix: Use BC Math for payments; fix wemall; add docs
Convert monetary/integral fields to string and switch arithmetic to BC Math to avoid floating-point errors; adjust return types to strings where appropriate (Balance, Integral, PaymentUsageTrait, IntegralPayment). Add input validation and safer comparisons in payment checks. Fix wemall logic and typos (early return for canceled/refunded orders, rename/logic fixes in UserRebate, initialize temporary $code variables, correct timestamp field name, adjust reward calculations to use bcmath, change wRebate signature). Add a database migration to enforce constraints, add new columns and indexes for wemall and payment tables. Also add business-feature documentation blocks across multiple plugin README files and update the project README.
2026-02-01 01:30:19 +08:00
邹景立
45ecf1f549 fix: 更新注释及开放Helper工具包 2025-03-01 22:33:38 +08:00
邹景立
9aab0a55b1 fix: 修改项目文档说明 2024-08-05 23:58:38 +08:00
邹景立
0cded14ac3 fix: 修改文档描述 2024-08-05 23:54:34 +08:00
邹景立
f8aaac9066 update: 更新项目说明 2024-08-03 23:06:40 +08:00
邹景立
ce7375ce87 增加 Github Actions 脚本 2024-08-02 08:45:48 +08:00