From cd33c3f398ecbc8c01687732b48a2e3c8d4ce75d Mon Sep 17 00:00:00 2001 From: liapples Date: Thu, 29 Jul 2021 19:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=90=86=E5=95=86?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Controller.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 7174952..0c9b7d9 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -38,16 +38,12 @@ class Controller extends BaseController } //检查代理商 - $this->agent_id = Cache::get($appid); - if (!$this->agent_id) { - $this->error('商户不存在或已被禁用'); - exit(); - } - $agent = Agent::query()->firstWhere(['id' => $this->agent_id, 'status' => 1]); + $agent = Agent::query()->firstWhere(['appid' => $appid, 'status' => 1]); if (!$agent) { $this->error('商户不存在或已被禁用'); exit(); } + $this->agent_id = $agent->id; } protected function success($data = [], $msg = 'success', $code = 0, $status = 200) @@ -57,7 +53,7 @@ class Controller extends BaseController 'msg' => $msg, 'data' => $data, 'status' => $status, - 'time' => microtime(true) - LARAVEL_START + 'debug_time' => microtime(true) - LARAVEL_START ])->send(); } @@ -68,7 +64,7 @@ class Controller extends BaseController 'msg' => $msg, 'data' => [], 'status' => $status, - 'time' => microtime(true) - LARAVEL_START + 'debug_time' => microtime(true) - LARAVEL_START ])->send(); } }