Commit 3936c37c authored by hujun's avatar hujun

去除过期绑定关系

parent 7290a911
...@@ -267,9 +267,8 @@ class PrivacyNumber ...@@ -267,9 +267,8 @@ class PrivacyNumber
} }
/** /**
* 检查绑定关系,去除表中不存在的绑定关系 * 去除过期绑定关系
* *
* @throws \Aliyun\Core\Exception\ClientException
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
...@@ -280,16 +279,11 @@ class PrivacyNumber ...@@ -280,16 +279,11 @@ class PrivacyNumber
$m_bind = new BindingPhone(); $m_bind = new BindingPhone();
$where['a.status'] = 1; $where['a.status'] = 1;
$where['a.type'] = 1;
$where['a.expiry_date'] = [ '<', date('Y-m-d H:i:s') ]; $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); $select_data = $m_bind->getBindingPhoneList('a.id,a.aliYun_phone_id', $where);
foreach ($select_data['data'] as $k => $v) { foreach ($select_data['data'] as $k => $v) {
$query_status = PlsDemo::querySubscriptionDetail($v['subsId'], $v['phone_x']);
if (isset($query_status->Code) && ($query_status->Code != 'OK')) {
$m_bind->unBindTable($v['id'], $v['aliYun_phone_id']); $m_bind->unBindTable($v['id'], $v['aliYun_phone_id']);
} }
}
return; return;
} }
......
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