Exemplo n.º 1
0
 public function pushToList($from, array $to, $objectName, $content, $pushContent = null, $pushData = null, $count = null, $verifyBlacklist = 0, $isPersisted = 0, $isCounted = 0)
 {
     $params = ['fromUserId' => $this->getUserAlias($from), 'toUserId' => $this->getUserAliases($to), 'objectName' => $objectName, 'content' => $content, 'verifyBlacklist' => $verifyBlacklist, 'isPersisted' => $isPersisted, 'isCounted' => $isCounted];
     if (null !== $pushContent) {
         $params['pushContent'] = $pushContent;
     }
     if (null !== $pushData) {
         $params['pushData'] = $pushData;
     }
     if (null !== $count) {
         $params['count'] = $count;
     }
     $response = $this->request('/message/private/publish', $params);
     $results = Json::decode($response, true);
     if (!isset($results['code']) || 200 != $results['code']) {
         throw new ResultException($response, '发送失败');
     }
     return true;
 }