Accept Merge Request #215: (feature/dgg -> develop)
Merge Request: feat: 【小程序】debug Created By: @大狗哥 Accepted By: @大狗哥 URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/215?initial=true
This commit is contained in:
commit
53fa5d7932
18
application/common/model/DebugLog.php
Normal file
18
application/common/model/DebugLog.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class DebugLog extends Model
|
||||
{
|
||||
protected $visible = [
|
||||
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ use app\common\model\OrderDispatch;
|
|||
use app\common\model\Order;
|
||||
use app\common\model\Abnormal;
|
||||
use app\common\model\OrderAbnormal;
|
||||
use app\common\model\DebugLog;
|
||||
//{%add use model%}
|
||||
|
||||
class BaseService
|
||||
|
|
@ -144,5 +145,21 @@ class BaseService
|
|||
return app(OrderAbnormal::class, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DebugLogService
|
||||
*/
|
||||
protected function getDebugLogService()
|
||||
{
|
||||
return app(DebugLogService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DebugLog
|
||||
*/
|
||||
protected function getDebugLogModel()
|
||||
{
|
||||
return app(DebugLog::class, true);
|
||||
}
|
||||
|
||||
//{%add function code%}
|
||||
}
|
||||
|
|
|
|||
17
application/services/DebugLogService.php
Normal file
17
application/services/DebugLogService.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace app\services;
|
||||
|
||||
class DebugLogService extends BaseService
|
||||
{
|
||||
public function create(string $title, string $content)
|
||||
{
|
||||
$model = $this->getDebugLogModel();
|
||||
$model->title = $title;
|
||||
$model->content = $content;
|
||||
$model->create_time = datetime(time());
|
||||
$model->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user