|
|
@@ -531,6 +531,10 @@ class wxUtil
|
|
|
*/
|
|
|
public static function sendTaskInform($data, $merchant, $isOpen = 0)
|
|
|
{
|
|
|
+ $wxNotice = dict::getDict('wxNotice');
|
|
|
+ if($wxNotice == 0){
|
|
|
+ return [];
|
|
|
+ }
|
|
|
$accessToken = self::getAuthorizerAccessToken($merchant, $isOpen);
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={$accessToken}";
|
|
|
$data = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
|
|
|
@@ -542,18 +546,6 @@ class wxUtil
|
|
|
return $arr;
|
|
|
}
|
|
|
|
|
|
- public static function sendTaskInform2($data, $merchant, $isOpen = 0)
|
|
|
- {
|
|
|
- $accessToken = self::getAuthorizerAccessToken($merchant, $isOpen);
|
|
|
- $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={$accessToken}";
|
|
|
- $data = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
|
|
|
- $curl = new curl\Curl();
|
|
|
- $response = $curl->setOption(CURLOPT_POSTFIELDS, $data)->post($url);
|
|
|
- Yii::info('发送模板消息返回哈:' . $response);
|
|
|
- $arr = json_decode($response);
|
|
|
- return $arr;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 创建模板消息
|
|
|
*/
|