提现发送短信

This commit is contained in:
“wanyongkang”
2023-07-28 18:54:34 +08:00
parent e8fcbed5a2
commit 02301f9c1c
2 changed files with 41 additions and 3 deletions

View File

@@ -53,4 +53,31 @@ class Sms
return ['code' => 1];
}
/**
* @param string[] $args
* @return void
*/
public static function sendToCashout($phone,$data){
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => $phone,
"signName" => "聚IP",
"templateCode" => "SMS_462280213",
"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];
}
}