コード例 #1
0
ファイル: Staff.php プロジェクト: nutsdo/rp-wechat
 /**
  * 发送消息
  *
  * @param string $openId
  *
  * @return bool
  */
 public function to($openId)
 {
     if (empty($this->message)) {
         throw new Exception('未设置要发送的消息');
     }
     $this->message->to = $openId;
     return $this->http->jsonPost(self::API_MESSAGE_SEND, $this->message->buildForStaff());
 }
コード例 #2
0
ファイル: Staff.php プロジェクト: xutongtong/wechat
 /**
  * 发送消息
  *
  * @param string $openId
  *
  * @return boolean
  */
 public function to($openId)
 {
     if (empty($this->message)) {
         throw new Exception("未设置要发送的消息");
     }
     $this->message->to = $openId;
     Wechat::request('POST', self::API_MESSAGE_SEND, $this->message->buildForStaff());
     return true;
 }
コード例 #3
0
ファイル: StaffBiz.php プロジェクト: shoaly/wechat-biz
 /**
  * 发送消息
  *
  * @param string $openId
  *
  * @return bool
  */
 public function totag($tagid, $agentid = 1)
 {
     if (empty($this->message)) {
         throw new Exception('未设置要发送的消息');
     }
     $this->message->totag = $tagid;
     $this->message->agentid = $agentid;
     $message_body = $this->message->buildForStaff();
     return $this->http->jsonPost(self::API_MESSAGE_SEND, $message_body);
 }