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
9c82eab7
Commit
9c82eab7
authored
Feb 28, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
释放过期的绑定关系
parent
49d6f7b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+34
-1
No files found.
application/task/controller/PrivacyNumber.php
View file @
9c82eab7
...
...
@@ -34,7 +34,7 @@ class PrivacyNumber
$report
=
new
SecretReport
();
$report
->
allowField
(
true
)
->
save
(
$post_data
[
0
]);
Log
::
write
(
serializ
e
(
$post_data
[
0
]),
'AliYunSecretReport'
);
//记录日志
Log
::
write
(
json_encod
e
(
$post_data
[
0
]),
'AliYunSecretReport'
);
//记录日志
return
json_encode
([
'code'
=>
0
,
'msg'
=>
'接收成功'
]);
}
...
...
@@ -69,4 +69,36 @@ class PrivacyNumber
return
;
}
/**
* 释放过期的绑定关系
*
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @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
();
$time
=
strtotime
(
date
(
'Y-m-d'
));
//今天0点
$binding_phone_id
=
[];
$phone_id
=
[];
foreach
(
$bind_data
as
$k
=>
$v
)
{
$date
=
date
(
'Y-m-d'
,
strtotime
(
$bind_data
[
'create_time'
])
+
_EXPIRATION
);
//有限期
$data
=
strtotime
(
$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'
];
}
}
$id
[
'aliYun_binding_phone'
]
=
implode
(
','
,
$binding_phone_id
);
$id
[
'aliYun_phone'
]
=
implode
(
','
,
array_unique
(
$phone_id
));
Log
::
write
(
json_encode
(
$id
),
'AliYunReleaseNumber'
);
//记录日志
return
;
}
}
\ 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