request->input('pay_order_number', ''); if (!$payOrderNumber) { throw new BusinessException('缺少参数[pay_order_number]'); } Queue::push(AfterSpendJob::class, ['pay_order_number' => $payOrderNumber]); return $this->success(); } public function login() { $userId = (int)$this->request->input('user_id', 0); $gameId = (int)$this->request->input('game_id', 0); $loginTime = (int)$this->request->input('login_time', 0); $sdkVersion = $this->request->input('sdk_version', 0); $clientIp = $this->request->input('client_ip', ''); $deviceNumber = $this->request->input('device_number', ''); if (!$userId) { throw new BusinessException('缺少参数[user_id]'); } if (!$gameId) { throw new BusinessException('缺少参数[game_id]'); } if (!$loginTime) { throw new BusinessException('缺少参数[login_time]'); } Queue::push(AfterLoginJob::class, [ 'user_id' => $userId, 'game_id' => $gameId, 'login_time' => $loginTime, 'sdk_version' => $sdkVersion, 'client_ip' => $clientIp, 'device_number' => $deviceNumber, ]); return $this->success(); } public function register() { $userId = $this->request->input('user_id', 0); $source = $this->request->input('source', 'SDK'); if (!$userId) { throw new BusinessException('缺少参数[user_id]'); } Queue::push(AfterRegisterJob::class, [ 'user_id' => $userId, ]); return $this->success(); } public function saveRole() { Queue::push(AfterSaveRoleJob::class, $this->request->all()); return $this->success(); } }