diff --git a/app/services/other/PrivacyPhoneServices.php b/app/services/other/PrivacyPhoneServices.php index d72dd5a..579104a 100644 --- a/app/services/other/PrivacyPhoneServices.php +++ b/app/services/other/PrivacyPhoneServices.php @@ -34,7 +34,7 @@ class PrivacyPhoneServices extends BaseServices */ public function getAppKey(): string { - return sys_config('privacy_phone_appkey', ''); + return env('PRIVACY_PHONE.APPKEY', ''); } /** @@ -43,7 +43,7 @@ class PrivacyPhoneServices extends BaseServices */ public function getAppSecret(): string { - return sys_config('privacy_phone_appsecret', ''); + return env('PRIVACY_PHONE.APPSECRET', ''); } /** @@ -52,7 +52,7 @@ class PrivacyPhoneServices extends BaseServices */ public function isEnabled(): bool { - return (bool)sys_config('privacy_phone_status', 0); + return (bool)env('PRIVACY_PHONE.ENABLE', false); } /** diff --git a/docs/privacy_phone_update.sql b/docs/privacy_phone_update.sql index 54a25e0..69f6bd5 100644 --- a/docs/privacy_phone_update.sql +++ b/docs/privacy_phone_update.sql @@ -3,18 +3,12 @@ -- 说明: AX模式下 user_phone 直接存储隐私手机号 -- private_bind_id 存储真实手机号(用于解绑) -- private_phone_status 存储绑定状态 +-- 配置方式: 通过 .env 文件配置 (不再使用数据库配置) --- 1. 订单表添加字段 +-- 订单表添加字段 ALTER TABLE `eb_store_order` ADD COLUMN `private_bind_id` VARCHAR(18) NOT NULL DEFAULT '' COMMENT '隐私绑定真实手机号(用于解绑)' AFTER `user_address`, ADD COLUMN `private_phone_status` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '隐私手机绑定状态:0未绑定,1已绑定' AFTER `private_bind_id`; --- 2. 系统配置表添加隐私手机号配置 -INSERT INTO `eb_system_config` (`id`, `is_store`, `menu_name`, `type`, `input_type`, `config_tab_id`, `parameter`, `upload_type`, `required`, `width`, `high`, `value`, `info`, `desc`, `sort`, `status`) VALUES -(NULL, 0, 'privacy_phone_status', 'radio', 'input', 1, '0=>关闭\n1=>开启', 0, '', 0, 0, '0', '隐私手机号功能', '开启后订单发货使用隐私手机号', 0, 1), -(NULL, 0, 'privacy_phone_appkey', 'text', 'input', 1, '', 0, 'required:true', 100, 0, '', '米糠云AppKey', '米糠云小号平台AppKey', 0, 1), -(NULL, 0, 'privacy_phone_appsecret', 'text', 'input', 1, '', 0, 'required:true', 100, 0, '', '米糠云AppSecret', '米糠云小号平台AppSecret', 0, 1); - -- 查询验证 -- SELECT id, order_id, user_phone, private_bind_id, private_phone_status FROM eb_store_order LIMIT 10; --- SELECT * FROM eb_system_config WHERE menu_name LIKE 'privacy_phone%';