Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
5d0f79c1
Commit
5d0f79c1
authored
Mar 02, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
释放号码修改
parent
c81f5663
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
config.php
application/api_broker/config.php
+1
-1
CellPhone.php
application/api_broker/controller/CellPhone.php
+2
-1
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+19
-9
No files found.
application/api_broker/config.php
View file @
5d0f79c1
...
...
@@ -3,7 +3,7 @@
error_reporting
(
E_ERROR
|
E_PARSE
);
define
(
'_MESSAGE_TYPE'
,
'SecretReport'
);
define
(
'_QUEUE_NAME'
,
'Alicom-Queue-1186048444498461-SecretReport'
);
define
(
'_EXPIRATION'
,
date
(
'Y-m-d H:i:s'
,
time
()
+
518400
));
//手机号码保留七天
define
(
'_EXPIRATION'
,
date
(
'Y-m-d H:i:s'
,
time
()
+
604800
));
//手机号码保留七天+1天用于释放
return
[
'jwt_key'
=>
'tonglian+123'
,
...
...
application/api_broker/controller/CellPhone.php
View file @
5d0f79c1
...
...
@@ -60,7 +60,8 @@ class CellPhone extends Basic
'subsId'
=>
$result
->
SecretBindDTO
->
SubsId
,
'requestId'
=>
$result
->
RequestId
,
'record'
=>
$record
,
'aliYun_phone_id'
=>
$phone_x
[
'id'
]
'aliYun_phone_id'
=>
$phone_x
[
'id'
],
'expiry_date'
=>
_EXPIRATION
,
]);
$this
->
msg
=
'Binding success.'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
...
...
application/task/controller/PrivacyNumber.php
View file @
5d0f79c1
...
...
@@ -9,6 +9,7 @@
namespace
app\task\controller
;
use
app\api_broker\untils\PlsDemo
;
use
app\model\BindingPhone
;
use
app\model\SecretReport
;
use
think\Db
;
use
think\Log
;
...
...
@@ -82,20 +83,29 @@ class PrivacyNumber
* @throws \think\exception\DbException
*/
public
function
releaseNumber
()
{
$bind_data
=
Db
::
table
(
'aliYun_binding_phone'
)
->
field
(
'id,aliYun_phone_id,create_time'
)
->
where
(
'status'
,
1
)
->
select
();
$bind_data
=
Db
::
table
(
'aliYun_binding_phone'
)
->
alias
(
'a'
)
->
join
(
'aliyun_phone b'
,
'a.aliYun_phone_id=b.id'
,
'left'
)
->
field
(
'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId'
)
->
where
(
'a.status'
,
1
)
->
select
();
$time
=
strtotime
(
date
(
'Y-m-d'
));
//今天0点
$binding_phone_id
=
[];
$phone_id
=
[];
$bind
=
new
BindingPhone
();
foreach
(
$bind_data
as
$k
=>
$v
)
{
$date
=
date
(
'Y-m-d'
,
strtotime
(
$bind_data
[
'create_time'
])
+
_EXPIRATION
);
//有限期
$data
=
strtotime
(
$date
);
$date
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
$v
[
'expiry_date'
])));
//解除绑定
if
(
$data
<=
$time
)
{
Db
::
table
(
'aliYun_binding_phone'
)
->
where
(
'id'
,
$v
[
'id'
])
->
setField
(
'status'
,
0
);
Db
::
table
(
'aliYun_phone'
)
->
where
(
'id'
,
$v
[
'aliYun_phone_id'
])
->
setField
(
'status'
,
0
);
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
if
(
$date
<=
$time
)
{
$subsId
=
$bind
->
getSubsId
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
],
1
);
$result
=
PlsDemo
::
unbindSubscription
(
$subsId
,
$v
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
$bind
->
UnBind
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
]);
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
}
}
}
...
...
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