Commit 4f1328fc authored by hujun's avatar hujun

定时任务-去除表中不存在的绑定关系修改

parent f145a24f
......@@ -99,6 +99,7 @@ class PrivacyNumber
*/
public function releaseNumber()
{
set_time_limit(0);
$m_bind = new BindingPhone();
$fields = 'a.id,aliYun_phone_id,expiry_date,phone_x,phone_a,phone_b,subsId,a.type,a.mappingId';
......@@ -218,17 +219,17 @@ class PrivacyNumber
*/
public function checkBindPhone()
{
set_time_limit(0);
$m_bind = new BindingPhone();
$where['a.status'] = 1;
$where['a.type'] = 1;
$where['a.expiry_date'] = ['<', date('Y-m-d H:i:s')];
$select_data = $m_bind->getBindingPhoneList('a.id,a.aliYun_phone_id,b.phone_x,a.subsId,a.expiry_date', $where);
foreach ($select_data as $k => $v) {
$query_status = PlsDemo::querySubscriptionDetail($v['subsId'], $v['phone_x']);
$expiry_date = strtotime($select_data['expiry_date']);
if (isset($query_status->code) && ($query_status->Code != 'OK') && ($expiry_date < time())) {
if (isset($query_status->Code) && ($query_status->Code != 'OK')) {
$m_bind->unBindTable($v['id'], $v['aliYun_phone_id']);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment