From 5aec64598f02966b38687c25569b700abbe496af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=9F=E5=B7=9D=E4=B8=9C?= Date: Thu, 3 Jul 2025 15:01:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E3=80=91debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/model/DebugLog.php | 18 ++++++++++++++++++ application/services/BaseService.php | 17 +++++++++++++++++ application/services/DebugLogService.php | 17 +++++++++++++++++ application/services/WorkerService.php | 6 ++++++ 4 files changed, 58 insertions(+) create mode 100644 application/common/model/DebugLog.php create mode 100644 application/services/DebugLogService.php diff --git a/application/common/model/DebugLog.php b/application/common/model/DebugLog.php new file mode 100644 index 0000000..907d04a --- /dev/null +++ b/application/common/model/DebugLog.php @@ -0,0 +1,18 @@ +getDebugLogModel(); + $model->title = $title; + $model->content = $content; + $model->create_time = datetime(time()); + $model->save(); + + return true; + } +} diff --git a/application/services/WorkerService.php b/application/services/WorkerService.php index b053f81..bcd8559 100644 --- a/application/services/WorkerService.php +++ b/application/services/WorkerService.php @@ -16,6 +16,12 @@ class WorkerService extends BaseService { $phone = $this->getPhoneNumber($code); $worker = $this->getWorkerService()->getByTel($phone); + + // debug + if (empty($worker)) { + $this->getDebugLogService()->create('小程序登录没通过手机号找到师傅', "手机号:$phone"); + } + $this->tryBindPhoneNumber($worker); $tokenData = Token::get($vendorToken);