|
|
|
@ -1101,7 +1101,20 @@ function return_pay_config($campus_id, $order_id) |
|
|
|
{ |
|
|
|
$campus_pay = new \app\model\campus_pay\CampusPay(); |
|
|
|
$pay_config = $campus_pay->where(['campus_id' => $campus_id])->find(); |
|
|
|
|
|
|
|
/** |
|
|
|
* [ |
|
|
|
* "id" => 3 |
|
|
|
* "campus_id" => 3 |
|
|
|
* "mchid" => "1683015573" |
|
|
|
* "pay_sign_key" => "eMxxEaxmzWo0FeMasMGPZDAC2vEZtVpE" |
|
|
|
* "apiclient_key" => "upload/attachment/document/cert/202508/08/apiclient_cert.pem" |
|
|
|
* "apiclient_cert" => "upload/attachment/document/cert/202508/08/apiclient_key.pem" |
|
|
|
* "wx_pay_key" => "upload/attachment/document/cert/202508/09/pub_key.pem" |
|
|
|
* "wx_pay_key_id" => "PUB_KEY_ID_0116830155732025080800112116001001" |
|
|
|
* "created_at" => "2025-08-08 19:34:38" |
|
|
|
* "updated_at" => "2025-08-09 00:02:13" |
|
|
|
* ] |
|
|
|
*/ |
|
|
|
$sysConfig = new SysConfig(); |
|
|
|
|
|
|
|
$vx_config = $sysConfig->where(['config_key' => 'weapp'])->value("value"); |
|
|
|
@ -1124,6 +1137,8 @@ function return_pay_config($campus_id, $order_id) |
|
|
|
// 选填-小程序 的 app_id |
|
|
|
'mini_app_id' => '', |
|
|
|
'mch_secret_key' => $pay_config['pay_sign_key'], |
|
|
|
'wechat_public_cert_path' => $pay_config['wx_pay_key'] ?? '', |
|
|
|
'wechat_public_cert_id' => $pay_config['wx_pay_key_id'] ?? '', |
|
|
|
]; |
|
|
|
|
|
|
|
return $config; |
|
|
|
@ -1304,7 +1319,8 @@ function get_role_type($role_id) |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
function isDateInThisWeek($date) { |
|
|
|
function isDateInThisWeek($date) |
|
|
|
{ |
|
|
|
$timestamp = strtotime($date); |
|
|
|
|
|
|
|
// 获取本周开始和结束时间戳(周一到周日) |
|
|
|
@ -1314,7 +1330,8 @@ function isDateInThisWeek($date) { |
|
|
|
return $timestamp >= $monday && $timestamp <= $sunday; |
|
|
|
} |
|
|
|
|
|
|
|
function isDateInLastWeek($date) { |
|
|
|
function isDateInLastWeek($date) |
|
|
|
{ |
|
|
|
$timestamp = strtotime($date); |
|
|
|
|
|
|
|
// 获取上周的周一(开始)和周日(结束) |
|
|
|
@ -1325,7 +1342,6 @@ function isDateInLastWeek($date) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getChineseWeekday($date) |
|
|
|
{ |
|
|
|
$weekdays = ['日', '一', '二', '三', '四', '五', '六']; |
|
|
|
@ -1391,7 +1407,8 @@ function get_staff_performance_total(int $staffId, string $performanceType = '', |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function httpGet($url) { |
|
|
|
function httpGet($url) |
|
|
|
{ |
|
|
|
$curl = curl_init(); |
|
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
|
|
|
curl_setopt($curl, CURLOPT_TIMEOUT, 500); |
|
|
|
@ -1406,8 +1423,8 @@ function httpGet($url) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getAccessToken() { |
|
|
|
function getAccessToken() |
|
|
|
{ |
|
|
|
$appId = 'wxe48c268ac1c97ab9'; |
|
|
|
$appSecret = 'fc355f42f55e693595d31e0e644bd11c'; |
|
|
|
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret"; |
|
|
|
@ -1419,13 +1436,14 @@ function getAccessToken() { |
|
|
|
//$touser 用户的openid |
|
|
|
//$template_id 模板id |
|
|
|
//$value 发送的 消息 数组 |
|
|
|
function sendMessage($touser,$template_id,$value) { |
|
|
|
function sendMessage($touser, $template_id, $value) |
|
|
|
{ |
|
|
|
// 构建请求参数 |
|
|
|
$accessToken = getAccessToken(); |
|
|
|
$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 == 'K5YS7UBbD18PZvqUmnBKfX_j8tKP_AUAKa75mwUsX0A'){ |
|
|
|
if ($template_id == 'K5YS7UBbD18PZvqUmnBKfX_j8tKP_AUAKa75mwUsX0A') { |
|
|
|
$data = [ |
|
|
|
'touser' => $touser, |
|
|
|
'template_id' => $template_id, |
|
|
|
@ -1443,7 +1461,7 @@ function sendMessage($touser,$template_id,$value) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($template_id == 'FrAKIn9zs0qdxWFW1R9vnR2WDJgil2KCg-9cLFaHFWM'){ |
|
|
|
if ($template_id == 'FrAKIn9zs0qdxWFW1R9vnR2WDJgil2KCg-9cLFaHFWM') { |
|
|
|
$data = [ |
|
|
|
'touser' => $touser, |
|
|
|
'template_id' => $template_id, |
|
|
|
|