Commit 11061243 authored by wwccw0591's avatar wwccw0591

sms message

parent dd8b9e03
...@@ -16,7 +16,7 @@ class Sms { ...@@ -16,7 +16,7 @@ class Sms {
* @param $param * @param $param
* @return mixed * @return mixed
*/ */
public static function sendSms($mobile,$templateId,$param) { public static function sendSms($mobile, $templateId, $param) {
$params = array (); $params = array ();
$accessKeyId = \Our\SecretKeys::aliYunSmsAppId; $accessKeyId = \Our\SecretKeys::aliYunSmsAppId;
...@@ -68,4 +68,4 @@ class Sms { ...@@ -68,4 +68,4 @@ class Sms {
//return $content; //return $content;
} }
} }
\ No newline at end of file
...@@ -16,4 +16,33 @@ class SmsTemplateConst{ ...@@ -16,4 +16,33 @@ class SmsTemplateConst{
'code', 'code',
) )
); );
} /**
\ No newline at end of file * 统一内容短信相关参数
*
* User: linqin <358887571@qq.com>
*/
const messageSmsContent = array(
//商户微信支付申请开通通知 尊敬的${storename},我的身边店已成功在微信支付为您申请特约商户号,请您尽快前往预留邮箱进行后续操作。
'mchWxPayOpen' => array(
'templateId'=>'SMS_151547275',
'parameters'=>array(
'storename',
)
),
//商户微信支付申请退回通知 尊敬的${storename},您提供的线上支付材料不合格,退回理由:${reason},请尽快登录商户管理中心处理。
'mchWxPayReturn'=> array(
'templateId'=>'SMS_151547236',
'parameters'=>array(
'storename',
'reason',
)
),
//商户微信支付申请退回通知 尊敬的${storename},我的身边店已在微信支付平台发起授权申请,请您尽快前往微信支付商户平台操作。
'mchWxPayGrant' => array(
'templateId'=>'SMS_151547241',
'parameters'=>array(
'storename',
)
),
);
}
...@@ -62,7 +62,12 @@ class ShortMessageModel { ...@@ -62,7 +62,12 @@ class ShortMessageModel {
return $result; return $result;
} }
/**
* 发送验证码短信
* @param $mobile 手机
* @param $content 内容
* @return bool
*/
public function sendValidCodeSmsForPlatform($mobile,$content){ public function sendValidCodeSmsForPlatform($mobile,$content){
$smsTemplate = \Our\SmsTemplateConst::verifyCodeSmsContent; $smsTemplate = \Our\SmsTemplateConst::verifyCodeSmsContent;
...@@ -76,6 +81,31 @@ class ShortMessageModel { ...@@ -76,6 +81,31 @@ class ShortMessageModel {
return false; return false;
} }
/**
* 发送内容短信
* @param $mobile 手机号
* @param $code 短信代码
* @param $params 参数
* @return bool 操作结果
* User: linqin <358887571@qq.com>
* Date: 2018/11/22 0022
* Time: 下午 4:53
*/
public function sendMessageSmsForPlatform($mobile, $code, $params){
$smsTemplate = \Our\SmsTemplateConst::messageSmsContent;
$template = $smsTemplate[$code];
if($template) {
$templateId = $template['templateId'];
// $param = $template['parameters'];
$result = \AliyunSms\Sms::sendSms($mobile, $templateId, $params);
if($result['status']){
return true;
}
}
return false;
}
/** /**
* 验证验证码是否有效 * 验证验证码是否有效
...@@ -177,4 +207,4 @@ class ShortMessageModel { ...@@ -177,4 +207,4 @@ class ShortMessageModel {
return self::$_instance; return self::$_instance;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment