terminal = $terminal; $this->config = WeChatConfigService::getPayConfigByTerminal($terminal); $this->app = new Application($this->config); if ($userId !== null) { $this->auth = UserAuth::where(['user_id' => $userId, 'terminal' => $terminal])->findOrEmpty(); } } }