feat: 用户端与师傅端双小程序架构解耦,新增师傅独立认证及超时自动关单机制
1. 账号体系与数据库解耦: - 师傅表 fa_master 解除对 fa_user.id 的外键依赖,升级为独立认证账号主表; - 新增师傅端独立支撑表:fa_master_security、fa_master_token、fa_master_wechat、fa_master_agreement_read; - 新增工单超时未接单自动关闭与原路退款配置(order_unaccepted_close_days)。 2. 服务端(Server): - 新增师傅端独立 API 控制器与认证库(MasterAuth, MasterBase, MasterMessage, MasterSecurity, MasterToken); - WxLogin 支持双小程序端(user/master)独立换取 session_key、openid 与 access_token; - 新增控制台调度命令 php think order:autoclose,支持订单超时自动关闭与售后退款闭环; - 修复 PHP 8.5 兼容性问题(Request.php 的 (bool) 强制转换); - 系统业务配置全面收敛至数据库 fa_config 及 site.php。 3. 小程序端: - yjyf-app(用户端):彻底剥离师傅端路由、组件及静态资源,增加隐私授权弹窗与评价模块; - yjyf-master-app(师傅端):全新独立微信小程序工程(wx140d90ceda786107),实现工作台、接单大厅、资质认证、工单协同与钱包提现完整闭环。
这个提交包含在:
@@ -136,25 +136,6 @@ username = yjyf
|
||||
password = yjyf
|
||||
hostport = 3306
|
||||
prefix = fa_
|
||||
|
||||
[wechat]
|
||||
appid = wx40ca4b02d4d1cb58
|
||||
secret = f661146ce627e2c57770b7d80164dd65
|
||||
mch_id = 1119105317
|
||||
key = ffyqcyyszhdhi398672363efnwvikxlv
|
||||
key_v3 = ffyqcyyszhdhi398672363efnwvikxlv
|
||||
public_key_id = PUB_KEY_ID_0111191053172026102200381630000600
|
||||
notify_domain = https://yjyf.gzyakj.com.cn
|
||||
transfer_scene_id = 1005
|
||||
transfer_single_limit = 200.00
|
||||
transfer_daily_user_limit = 200.00
|
||||
|
||||
[tianditu]
|
||||
key = 55aee666be14cd0100874d6faf3c963c
|
||||
|
||||
[sms]
|
||||
mock = 1
|
||||
mock_code = 123456
|
||||
"""
|
||||
with sftp.file(f"{REMOTE_SITE_DIR}/.env", 'w') as f:
|
||||
f.write(remote_env_content)
|
||||
@@ -174,7 +155,7 @@ run_ssh(f"chmod -R 755 {REMOTE_SITE_DIR}")
|
||||
print(" 重载 PHP-FPM 服务...")
|
||||
out_fpm, _, _ = run_ssh("/etc/init.d/php-fpm-85 reload")
|
||||
print(f" PHP-FPM 重载状态: {out_fpm.strip()}")
|
||||
time.sleep(1)
|
||||
time.sleep(2)
|
||||
|
||||
# 7. 部署后验证与质检
|
||||
print("\n[步骤 7/7] 执行部署后全链路验证...")
|
||||
@@ -184,13 +165,15 @@ out_tb, _, _ = run_ssh("mysql -uyjyf -pyjyf yjyf -e 'SHOW TABLES;'")
|
||||
remote_tables = [l.strip() for l in out_tb.strip().splitlines() if l.strip() and l.strip() != 'Tables_in_yjyf']
|
||||
print(f" 远程 yjyf 数据库表数量: {len(remote_tables)}")
|
||||
|
||||
# 验证 pricing_config 字段是否存在
|
||||
out_col, _, _ = run_ssh("mysql -uyjyf -pyjyf yjyf -e \"SHOW COLUMNS FROM fa_service LIKE 'pricing_config';\"")
|
||||
print(f" fa_service.pricing_config 字段验证:\n{out_col.strip()}")
|
||||
# 验证师傅端新表与字段
|
||||
out_m_sec, _, _ = run_ssh("mysql -uyjyf -pyjyf yjyf -e 'SHOW TABLES LIKE \"fa_master_%\";'")
|
||||
print(f" 师傅端核心支撑表列表:\n{out_m_sec.strip()}")
|
||||
|
||||
check_sql = (
|
||||
"SELECT 'fa_user' AS tb, COUNT(*) AS cnt FROM fa_user UNION ALL "
|
||||
"SELECT 'fa_master', COUNT(*) FROM fa_master UNION ALL "
|
||||
"SELECT 'fa_master_security', COUNT(*) FROM fa_master_security UNION ALL "
|
||||
"SELECT 'fa_master_token', COUNT(*) FROM fa_master_token UNION ALL "
|
||||
"SELECT 'fa_order', COUNT(*) FROM fa_order UNION ALL "
|
||||
"SELECT 'fa_service', COUNT(*) FROM fa_service UNION ALL "
|
||||
"SELECT 'fa_service_type', COUNT(*) FROM fa_service_type UNION ALL "
|
||||
@@ -217,7 +200,15 @@ print(f" - 首页接口 (/api/home/index): {out_home[:120]}...")
|
||||
out_dicts, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/common/dicts")
|
||||
print(f" - 字典接口 (/api/common/dicts): {out_dicts[:120]}...")
|
||||
|
||||
# 7.3 验证其他站点未受影响
|
||||
out_master_auth, _, _ = run_ssh("curl -k -s -X POST https://yjyf.gzyakj.com.cn/api/master_auth/login -d 'mobile=18888888888'")
|
||||
print(f" - 师傅端登录接口 (/api/master_auth/login): {out_master_auth[:120]}...")
|
||||
|
||||
# 7.3 验证 think 控制台指令
|
||||
print("\n 测试 ThinkPHP 控制台命令:")
|
||||
out_cmd, _, _ = run_ssh("php /www/wwwroot/yjyf.gzyakj.com.cn/think order:autoclose")
|
||||
print(f" - php think order:autoclose: {out_cmd.strip()}")
|
||||
|
||||
# 7.4 验证其他站点未受影响
|
||||
print("\n 验证其他站点未受影响:")
|
||||
other_sites = ['fenleixinxi.gzyakj.com.cn', 'huaqiapp.gzyakj.com.cn', 'renqing', 'rqzb.gyscwl.com']
|
||||
for s in other_sites:
|
||||
|
||||
在新工单中引用
屏蔽一个用户