|
|
|
@ -1108,7 +1108,7 @@ function return_pay_config($campus_id, $order_id) |
|
|
|
// 必填-商户公钥证书路径 |
|
|
|
'mch_public_cert_path' => $pay_config['apiclient_key'], |
|
|
|
// 必填 |
|
|
|
'notify_url' => 'https://zh.hnhbty.cn/api/pay/qrcodenotify/order_id/' . $order_id, |
|
|
|
'notify_url' => 'https://api.hnhbty.cn/api/pay/qrcodenotify/order_id/' . $order_id, |
|
|
|
// 选填-公众号 的 app_id |
|
|
|
'mp_app_id' => $vx_config['app_id'], |
|
|
|
// 选填-小程序 的 app_id |
|
|
|
@ -1361,3 +1361,63 @@ function get_staff_performance_total(int $staffId, string $performanceType = '', |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function httpGet($url) { |
|
|
|
$curl = curl_init(); |
|
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
|
|
|
curl_setopt($curl, CURLOPT_TIMEOUT, 500); |
|
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
|
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); |
|
|
|
curl_setopt($curl, CURLOPT_URL, $url); |
|
|
|
|
|
|
|
$res = curl_exec($curl); |
|
|
|
curl_close($curl); |
|
|
|
|
|
|
|
return $res; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getAccessToken() { |
|
|
|
$appId = 'wxaee2df4a4b31df05'; |
|
|
|
$appSecret = '06284bac15b25775293690765a6be4d9'; |
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret"; |
|
|
|
$res = json_decode(httpGet($url)); |
|
|
|
$access_token = $res->access_token; |
|
|
|
return $access_token; |
|
|
|
} |
|
|
|
|
|
|
|
//$touser 用户的openid |
|
|
|
//$template_id 模板id |
|
|
|
//$value 发送的 消息 数组 |
|
|
|
function sendMessage($touser,$template_id,$value) { |
|
|
|
// 构建请求参数 |
|
|
|
$accessToken = getAccessToken(); |
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" .$accessToken; |
|
|
|
|
|
|
|
|
|
|
|
if($template_id == 'ogmlvTC-Q2gLMBbRHAUKCSWpwyQIOrLBA30HyAKkEXg'){ |
|
|
|
$data = [ |
|
|
|
'touser' => $touser, |
|
|
|
'template_id' => $template_id, |
|
|
|
'data' => [ |
|
|
|
'thing3' => ['value' => $value['thing3'], 'color' => '#173177'], //课程名称 |
|
|
|
'time4' => ['value' => $value['time4'], 'color' => '#173177'],//课程周期 例子 2023年10月11日~2023年11月30日 |
|
|
|
'character_string7' => ['value' => $value['character_string7'], 'color' => '#173177'],//课程数量 |
|
|
|
'character_string9' => ['value' => $value['character_string9'], 'color' => '#173177'],//课程码 课程金额 |
|
|
|
'time5' => ['value' => $value['time5'], 'color' => '#173177']//上课时间 |
|
|
|
], |
|
|
|
'miniprogram' => [ |
|
|
|
"appid" => "wxaee2df4a4b31df05", |
|
|
|
"pagepath" => $value['pagepath'] |
|
|
|
] |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
// 发送 POST 请求 |
|
|
|
$ch = curl_init($url); |
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
|
|
curl_setopt($ch, CURLOPT_POST, true); |
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); |
|
|
|
$response = curl_exec($ch); |
|
|
|
curl_close($ch); |
|
|
|
|
|
|
|
} |
|
|
|
|