toData('400', '参数错误'); } if (!is_string($param['content'])) { return $this->toData('400', 'content参数必须为string类型'); } // 多个用户ID之间用英文逗号隔开的 $expUserID = explode(',', $param['user_id']); if (count($expUserID) <= 0) { return $this->toData('400', '用户ID不能为空'); } // 循环向每个用户发送弹窗 Gateway::$registerAddress = env('GATEWAY_SERVER.REGISTER'); foreach ($expUserID as $uid) { Gateway::sendToUid($uid, $param['content']); } return $this->toData('0', 'ok'); } catch (\Exception $e) { return $this->toData('500', 'The system error', [$e->getMessage(), $e->getTrace()]); } } }