terminal = $terminal; $config = Config::get('payment'); Pay::config($config); if ($userId !== null) { $this->auth = UserAuth::where(['user_id' => $userId, 'terminal' => $terminal])->findOrEmpty(); } $this->wechat=Pay::wechat(); } }