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(); } }