于宏哲PHP 8 months ago
parent
commit
3d50d51668
  1. 4
      niucloud/app/api/controller/login/Login.php
  2. 21
      niucloud/app/common.php

4
niucloud/app/api/controller/login/Login.php

@ -154,8 +154,8 @@ class Login extends BaseController
$v['wx_openid'], $v['wx_openid'],
$template_id, $template_id,
[ [
'thing4' => $v['course_name'].',您有一节课程还有不到24小时就要开始了,如需请假请提前6小时发起请假操作。', 'thing5' => $v['course_name'].',您有一节课程还有不到24小时就要开始了,如需请假请提前6小时发起请假操作。',
'thing6' => $v['course_date'].' '.$v['time_slot'], 'thing19' => $v['course_date'].' '.$v['time_slot'],
'pagepath' => '' 'pagepath' => ''
] ]
); );

21
niucloud/app/common.php

@ -1398,8 +1398,8 @@ function httpGet($url) {
function getAccessToken() { function getAccessToken() {
$appId = 'wxaee2df4a4b31df05'; $appId = 'wxe48c268ac1c97ab9';
$appSecret = '06284bac15b25775293690765a6be4d9'; $appSecret = 'fc355f42f55e693595d31e0e644bd11c';
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret"; $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret";
$res = json_decode(httpGet($url)); $res = json_decode(httpGet($url));
$access_token = $res->access_token; $access_token = $res->access_token;
@ -1415,16 +1415,15 @@ function sendMessage($touser,$template_id,$value) {
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" .$accessToken; $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" .$accessToken;
if($template_id == 'ogmlvTC-Q2gLMBbRHAUKCSWpwyQIOrLBA30HyAKkEXg'){ if($template_id == 'K5YS7UBbD18PZvqUmnBKfX_j8tKP_AUAKa75mwUsX0A'){
$data = [ $data = [
'touser' => $touser, 'touser' => $touser,
'template_id' => $template_id, 'template_id' => $template_id,
'data' => [ 'data' => [
'thing3' => ['value' => $value['thing3'], 'color' => '#173177'], //课程名称 'thing9' => ['value' => $value['thing9'], 'color' => '#173177'], //课程名称
'time4' => ['value' => $value['time4'], 'color' => '#173177'],//课程周期 例子 2023年10月11日~2023年11月30日 'time8' => ['value' => $value['time8'], 'color' => '#173177'],//课程周期 例子 2023年10月11日~2023年11月30日
'character_string7' => ['value' => $value['character_string7'], 'color' => '#173177'],//课程数量 'number4' => ['value' => $value['number4'], 'color' => '#173177'],//课程数量
'character_string9' => ['value' => $value['character_string9'], 'color' => '#173177'],//课程码 课程金额 'amount5' => ['value' => $value['amount5'], 'color' => '#173177']//课程码 课程金额
'time5' => ['value' => $value['time5'], 'color' => '#173177']//上课时间
], ],
'miniprogram' => [ 'miniprogram' => [
"appid" => "wxaee2df4a4b31df05", "appid" => "wxaee2df4a4b31df05",
@ -1434,13 +1433,13 @@ function sendMessage($touser,$template_id,$value) {
} }
if($template_id == 'SWODTQvQPaucMnDrszdYSy5wg5_24FIlyXZqxwbjRT8'){ if($template_id == 'FrAKIn9zs0qdxWFW1R9vnR2WDJgil2KCg-9cLFaHFWM'){
$data = [ $data = [
'touser' => $touser, 'touser' => $touser,
'template_id' => $template_id, 'template_id' => $template_id,
'data' => [ 'data' => [
'thing4' => ['value' => $value['thing4'], 'color' => '#173177'], 'thing5' => ['value' => $value['thing5'], 'color' => '#173177'],
'thing6' => ['value' => $value['thing6'], 'color' => '#173177'] 'thing19' => ['value' => $value['thing19'], 'color' => '#173177']
], ],
'miniprogram' => [ 'miniprogram' => [
"appid" => "wxaee2df4a4b31df05", "appid" => "wxaee2df4a4b31df05",

Loading…
Cancel
Save