原后台余额查询提醒

This commit is contained in:
“wanyongkang”
2023-10-18 15:54:28 +08:00
parent 8aedeaa9ac
commit 513f0dcd7c
2 changed files with 70 additions and 0 deletions

View File

@@ -80,4 +80,31 @@ class Sms
return ['code' => 1];
}
/**
* @param string[] $args
* @return void
*/
public static function sendToBalance($phone,$data){
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => $phone,
"signName" => "聚IP商城",
"templateCode" => "SMS_463687988",
"templateParam" => json_encode($data)
]);
// 复制代码运行请自行打印 API 的返回值
$sendResp = $client->sendSms($sendSmsRequest);
$code = $sendResp->body->code;
if (!Utils::equalString($code, "OK")) {
$return_info = [
'code' => 0,
'msg' => $sendResp->body->message
];
return $return_info;
}
return ['code' => 1];
}
}