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),实现工作台、接单大厅、资质认证、工单协同与钱包提现完整闭环。
这个提交包含在:
@@ -1622,7 +1622,8 @@ class Home extends Base
|
||||
public function agreement()
|
||||
{
|
||||
$type = trim((string)$this->request->param('type', 'user_service'));
|
||||
$item = \app\common\library\AgreementService::getByType($type, $this->uid());
|
||||
list($subjectId, $side) = $this->resolveAgreementSubject();
|
||||
$item = \app\common\library\AgreementService::getByType($type, $subjectId, $side);
|
||||
if (!$item) {
|
||||
$this->error('协议内容暂未配置或已下线');
|
||||
}
|
||||
@@ -1631,7 +1632,7 @@ class Home extends Base
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录用户已首次查看指定修订版本的协议(后续打开不再标背景色)
|
||||
* 记录用户或师傅已首次查看指定修订版本的协议(后续打开不再标背景色)
|
||||
*/
|
||||
public function agreementRead()
|
||||
{
|
||||
@@ -1640,10 +1641,27 @@ class Home extends Base
|
||||
}
|
||||
$type = trim((string)$this->request->post('type', 'privacy'));
|
||||
$revision = (int)$this->request->post('revision', 0);
|
||||
$res = \app\common\library\AgreementService::markUserRead($this->uid(), $type, $revision);
|
||||
list($subjectId, $side) = $this->resolveAgreementSubject();
|
||||
$res = \app\common\library\AgreementService::markUserRead($subjectId, $type, $revision, $side);
|
||||
$this->success('', $res);
|
||||
}
|
||||
|
||||
protected function resolveAgreementSubject()
|
||||
{
|
||||
if ($this->uid() > 0) {
|
||||
return [$this->uid(), 'user'];
|
||||
}
|
||||
$token = $this->request->server('HTTP_TOKEN', $this->request->request('token', ''));
|
||||
if ($token) {
|
||||
$masterAuth = \app\common\library\MasterAuth::instance();
|
||||
if ($masterAuth->init($token)) {
|
||||
return [(int)$masterAuth->id(), 'master'];
|
||||
}
|
||||
}
|
||||
$reqSide = trim((string)$this->request->param('side', ''));
|
||||
return [0, $reqSide === 'master' ? 'master' : 'user'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 官方系统图库(受下单所选类目控制,仅展示对应类目下的商品及参考图片;同源聚合系统图库表 + 细分规格图 + 商品主缩略图)
|
||||
*/
|
||||
@@ -1841,11 +1859,15 @@ class Home extends Base
|
||||
*/
|
||||
public function serviceConfig()
|
||||
{
|
||||
$userMini = \app\common\library\WxLogin::getMiniAppConfig('user');
|
||||
$masterMini = \app\common\library\WxLogin::getMiniAppConfig('master');
|
||||
$this->success('', [
|
||||
'service_phone' => trim((string)(\think\Config::get('site.service_phone') ?: '')),
|
||||
'service_work_time' => trim((string)(\think\Config::get('site.service_work_time') ?: '')),
|
||||
'service_corp_id' => trim((string)(\think\Config::get('site.service_corp_id') ?: '')),
|
||||
'service_kf_url' => trim((string)(\think\Config::get('site.service_kf_url') ?: '')),
|
||||
'user_appid' => $userMini['appid'],
|
||||
'master_appid' => $masterMini['appid'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户