Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
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
wangtao
projecttwo
Commits
352a6d8b
Commit
352a6d8b
authored
Jul 08, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sendsms
parent
8dfc00d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
SendSms.php
extend/tool/SendSms.php
+19
-2
No files found.
extend/tool/SendSms.php
View file @
352a6d8b
...
...
@@ -260,7 +260,15 @@ class SendSms
return
[
'msg'
=>
'发送成功'
,
'code'
=>
1
];
}
else
{
$this
->
clear_time_cache
();
return
$this
->
logAndReturn
(
$result
[
'Message'
]
??
'短信发送失败'
,
$mobile
,
$code
,
500
,
0
);
if
(
$result
[
'Code'
]
==
'isv.BUSINESS_LIMIT_CONTROL'
)
{
$result
[
'Code'
]
=
501
;
}
else
{
$result
[
'Code'
]
=
500
;
}
return
$this
->
logAndReturn
(
$result
[
'Message'
]
??
'短信发送失败'
,
$mobile
,
$code
,
$result
[
'Code'
],
0
);
}
}
catch
(
ClientException
|
ServerException
$e
)
{
$this
->
clear_time_cache
();
...
...
@@ -291,9 +299,18 @@ class SendSms
/**
* 记录日志并返回结果
*/
private
function
logAndReturn
(
string
$message
,
int
$mobile
,
int
$code
,
int
$resCode
,
int
$status
)
:
array
private
function
logAndReturn
(
string
$message
,
int
$mobile
,
int
$code
,
int
$resCode
,
int
$status
)
:
array
{
$this
->
logSms
(
$mobile
,
$message
,
$code
,
time
(),
$message
,
$resCode
,
$status
);
if
(
$resCode
==
501
)
{
$message
=
'发送次数过多,请稍后再试'
;
}
if
(
$status
!=
1
)
{
$message
=
'发送失败'
;
}
return
[
'msg'
=>
$message
,
'code'
=>
$status
];
}
...
...
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