feat: 集成隐私小号功能保护用户手机号

新增隐私小号服务类,在订单创建时自动绑定隐私手机号,收货时自动解绑
在快递发货和收货流程中使用隐私小号替代真实手机号,保护用户隐私
添加数据库字段存储绑定关系,提供系统配置开关和测试脚本
This commit is contained in:
2026-04-01 00:43:51 +08:00
parent 03a6ba7961
commit 42d98407de
14 changed files with 1722 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ use app\services\user\member\MemberCardServices;
use app\services\user\UserBillServices;
use app\services\user\UserBrokerageServices;
use app\services\user\UserServices;
use app\services\other\PrivacyPhoneServices;
use think\annotation\Inject;
use think\exception\ValidateException;
use think\facade\Log;
@@ -148,6 +149,17 @@ class StoreOrderTakeServices extends BaseServices
if (!($res1 && $res2 && $res3)) {
throw new ValidateException('收货失败!');
}
// 解绑隐私手机号 (AX模式)
// user_phone存储隐私号, private_bind_id存储真实手机号
if ($order['private_bind_id'] && $order['private_phone_status'] == 1) {
/** @var PrivacyPhoneServices $privacyPhoneServices */
$privacyPhoneServices = app()->make(PrivacyPhoneServices::class);
$unbindResult = $privacyPhoneServices->unbindForOrder($order['user_phone'], $order['private_bind_id']);
if ($unbindResult) {
$order->private_phone_status = 0;
$order->save();
}
}
return true;
}, $isTran);
}