Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
11061243
Commit
11061243
authored
Nov 22, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sms message
parent
dd8b9e03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
5 deletions
+64
-5
Sms.php
application/library/AliyunSms/Sms.php
+2
-2
SmsTemplateConst.php
application/library/Our/SmsTemplateConst.php
+30
-1
ShortMessage.php
application/models/DAO/ShortMessage.php
+32
-2
No files found.
application/library/AliyunSms/Sms.php
100755 → 100644
View file @
11061243
...
...
@@ -16,7 +16,7 @@ class Sms {
* @param $param
* @return mixed
*/
public
static
function
sendSms
(
$mobile
,
$templateId
,
$param
)
{
public
static
function
sendSms
(
$mobile
,
$templateId
,
$param
)
{
$params
=
array
();
$accessKeyId
=
\Our\SecretKeys
::
aliYunSmsAppId
;
...
...
@@ -68,4 +68,4 @@ class Sms {
//return $content;
}
}
\ No newline at end of file
}
application/library/Our/SmsTemplateConst.php
100755 → 100644
View file @
11061243
...
...
@@ -16,4 +16,33 @@ class SmsTemplateConst{
'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'
,
)
),
);
}
application/models/DAO/ShortMessage.php
View file @
11061243
...
...
@@ -62,7 +62,12 @@ class ShortMessageModel {
return
$result
;
}
/**
* 发送验证码短信
* @param $mobile 手机
* @param $content 内容
* @return bool
*/
public
function
sendValidCodeSmsForPlatform
(
$mobile
,
$content
){
$smsTemplate
=
\Our\SmsTemplateConst
::
verifyCodeSmsContent
;
...
...
@@ -76,6 +81,31 @@ class ShortMessageModel {
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 {
return
self
::
$_instance
;
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment