diff --git a/WeMini/Custom.php b/WeMini/Custom.php index 9c518f0..39cc378 100644 --- a/WeMini/Custom.php +++ b/WeMini/Custom.php @@ -25,9 +25,22 @@ use WeChat\Contracts\BasicWeChat; class Custom extends BasicWeChat { + /** + * 发送小程序客服消息 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function sendCustomMessage($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + /** * 创建商户 - * @param array $data 商户资料 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -40,7 +53,7 @@ class Custom extends BasicWeChat /** * 更新商户信息 - * @param array $data 商户资料 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -53,8 +66,8 @@ class Custom extends BasicWeChat /** - * 查询单个商户 - * @param array $data 查询参数 + * 拉取单个商户信息 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -67,8 +80,8 @@ class Custom extends BasicWeChat /** - * 查询商户列表 - * @param array $data 查询参数 + * 拉取多个商户信息 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -81,7 +94,7 @@ class Custom extends BasicWeChat /** * 发送客服消息 - * @param array $data 消息体(touser, msgtype, content 等) + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -94,7 +107,7 @@ class Custom extends BasicWeChat /** * 客服输入状态 - * @param array $data 输入状态参数 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -107,8 +120,8 @@ class Custom extends BasicWeChat /** - * 获取客服列表 - * @param string $business_id 子商户 business_id,普通小程序可为空 + * 获取客服基本信息 + * @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -125,7 +138,7 @@ class Custom extends BasicWeChat /** * 获取在线客服列表 - * @param string $business_id 子商户 business_id,普通小程序可为空 + * @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -141,8 +154,8 @@ class Custom extends BasicWeChat /** - * 新增客服账号 - * @param array $data 账号参数 + * 客服输入状态 + * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -156,8 +169,8 @@ class Custom extends BasicWeChat /** * 删除客服账号 - * @param string $kf_openid 客服 openid - * @param string $business_id 子商户 business_id,可为空 + * @param string $kf_openid 客服openid + * @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -173,8 +186,8 @@ class Custom extends BasicWeChat /** * 设置客服管理员 - * @param string $kf_openid 客服 openid - * @param string $business_id 子商户 business_id,可为空 + * @param string $kf_openid 客服openid + * @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -191,8 +204,8 @@ class Custom extends BasicWeChat /** * 取消客服管理员 - * @param string $kf_openid 客服 openid - * @param string $business_id 子商户 business_id,可为空 + * @param string $kf_openid 客服openid + * @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException