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
0a9ea7d3
Commit
0a9ea7d3
authored
Jun 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云定时解除绑定关系
parent
d75689b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+20
-18
No files found.
application/task/controller/PrivacyNumber.php
View file @
0a9ea7d3
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
namespace
app\task\controller
;
namespace
app\task\controller
;
use
app\api_broker\untils\PlsDemo
;
use
app\api_broker\untils\PlsDemo
;
use
app\api_broker\untils\RongDemo
;
use
app\model\AliYunSecretReport
;
use
app\model\AliYunSecretReport
;
use
app\model\BindingPhone
;
use
app\model\BindingPhone
;
use
app\model\SecretReport
;
use
app\model\SecretReport
;
...
@@ -86,7 +87,7 @@ class PrivacyNumber
...
@@ -86,7 +87,7 @@ class PrivacyNumber
}
}
}
}
return
;
return
;
}
}
/**
/**
...
@@ -100,33 +101,33 @@ class PrivacyNumber
...
@@ -100,33 +101,33 @@ class PrivacyNumber
{
{
$m_bind
=
new
BindingPhone
();
$m_bind
=
new
BindingPhone
();
$fields
=
'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subs
Id'
;
$fields
=
'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId,a.type,a.mapping
Id'
;
$where
[
'a.status'
]
=
1
;
$where
[
'a.status'
]
=
1
;
$where
[
'
b.type'
]
=
1
;
$where
[
'
a.expiry_date'
]
=
[
'<='
,
date
(
'Y-m-d'
)
.
' 23:59:59'
]
;
$bind_data
=
$m_bind
->
getBindingPhoneList
(
$fields
,
$where
);
$bind_data
=
$m_bind
->
getBindingPhoneList
(
$fields
,
$where
);
$time
=
strtotime
(
date
(
'Y-m-d'
));
//今天0点
$binding_phone_id
=
[];
$binding_phone_id
=
[];
$phone_id
=
[];
$phone_id
=
[];
$bind
=
new
BindingPhone
();
$bind
=
new
BindingPhone
();
foreach
(
$bind_data
as
$k
=>
$v
)
{
foreach
(
$bind_data
as
$k
=>
$v
)
{
$date
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
$v
[
'expiry_date'
])));
//解除绑定
//解除绑定
if
(
$date
<=
$time
)
{
if
(
$v
[
'type'
]
==
1
&&
!
empty
(
$v
[
'subsId'
]))
{
$subsId
=
$bind
->
getSubsId
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
],
1
);
//释放阿里云隐私号码
$result
=
PlsDemo
::
unbindSubscription
(
$v
[
'subsId'
],
$v
[
'phone_x'
]);
if
(
empty
(
$subsId
))
{
continue
;
}
$result
=
PlsDemo
::
unbindSubscription
(
$subsId
,
$v
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
if
(
$result
->
Message
==
'OK'
)
{
$bind
->
unBind
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$result
->
RequestId
);
$bind
->
unBind
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$result
->
RequestId
);
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
}
}
}
elseif
(
$v
[
'type'
]
==
2
&&
!
empty
(
$v
[
'mappingId'
]))
{
//释放容联云隐私号码
$tong_xun
=
new
RongDemo
();
$result
=
$tong_xun
->
releaseNumber
(
$v
[
'mappingId'
]);
/*解绑*/
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
$bind
->
unBind
(
$v
[
'phone_x'
],
$v
[
'phone_a'
],
$v
[
'phone_b'
]);
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
}
}
}
}
}
...
@@ -231,6 +232,6 @@ class PrivacyNumber
...
@@ -231,6 +232,6 @@ class PrivacyNumber
$m_bind
->
unBindTable
(
$v
[
'id'
],
$v
[
'aliYun_phone_id'
]);
$m_bind
->
unBindTable
(
$v
[
'id'
],
$v
[
'aliYun_phone_id'
]);
}
}
}
}
return
;
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