public function unbind()
{
$type = t($this->data['type']);
if ($type == 'phone') {
// $uname = model ( 'User' )->where ( 'uid=' . $this->mid )->getField ( 'uname' );
$res = model('User')->where('uid=' . $this->mid)->setField('phone', '');
if ($res !== false) {
model('User')->cleanCache($this->mid);
return array('status' => 1, 'msg' => '解绑成功');
} else {
return array('status' => 0, 'msg' => '解绑失败');
}
} else {
if (D('login')->where("uid={$this->mid} AND type='{$type}'")->delete()) {
S('user_login_' . $this->mid, null);
return array('status' => 1, 'msg' => '解绑成功');
} else {
return array('status' => 0, 'msg' => '解绑失败');
}
}
}