You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.6 KiB
92 lines
2.6 KiB
<?php
|
|
|
|
namespace app\base\service\user;
|
|
|
|
use app\base\model\app\AppAppleUser;
|
|
use app\base\model\app\AppQqUser;
|
|
use app\base\model\app\AppSinaweiboUser;
|
|
use app\base\model\app\AppUser;
|
|
use app\base\model\app\AppWeixinUser;
|
|
use app\base\model\mpweixin\MpweixinUser;
|
|
use app\base\model\wechat\WechatUser;
|
|
|
|
class User extends Base
|
|
{
|
|
|
|
/**
|
|
* 用户注销账户
|
|
* @date 2022-12-27
|
|
*/
|
|
public function destory($user_id)
|
|
{
|
|
$user_model = new \app\base\model\user\User();
|
|
$weixin_user_model = new AppWeixinUser();
|
|
$qq_user_model = new AppQqUser();
|
|
$sinaweibo_user_model = new AppSinaweiboUser();
|
|
$apple_user_model = new AppAppleUser();
|
|
$mpweixin_user_model = new MpweixinUser();
|
|
$wechat_user_model = new WechatUser();
|
|
$app_user_model = new AppUser();
|
|
|
|
if (!$user_id) {
|
|
return sendErrorArray(2001, 'USER_ID必须存在');
|
|
}
|
|
|
|
// USER表修改状态
|
|
$user_data = [
|
|
'id' => $user_id,
|
|
'status' => 3,
|
|
];
|
|
$res = $user_model->dataUpdate($user_data);
|
|
if (!$res) {
|
|
return sendErrorArray(2002, '注销账户失败');
|
|
}
|
|
|
|
// 微信授权用户表解除绑定
|
|
$res = $weixin_user_model->unbindAuth($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2003, '微信授权解绑失败');
|
|
}
|
|
|
|
// QQ授权用户表解除绑定
|
|
$res = $qq_user_model->unbindAuth($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2004, 'QQ授权解绑失败');
|
|
}
|
|
|
|
// 新浪微博授权用户表解除绑定
|
|
$res = $sinaweibo_user_model->unbindAuth($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2005, '新浪微博授权解绑失败');
|
|
}
|
|
|
|
// 苹果授权用户表解除绑定
|
|
$res = $apple_user_model->unbindAuth($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2006, 'Apple平台授权解绑失败');
|
|
}
|
|
|
|
// 微信小程序平台用户解绑
|
|
$res = $mpweixin_user_model->unbindPlatform($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2007, '小程序端授权解绑失败');
|
|
}
|
|
|
|
// 微信公众号平台用户解绑
|
|
$res = $wechat_user_model->unbindPlatform($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2008, '公众号端授权解绑失败');
|
|
}
|
|
|
|
// app平台平台用户解绑
|
|
$res = $app_user_model->unbindPlatform($user_id);
|
|
if (!$res) {
|
|
return sendErrorArray(2009, 'APP端授权解绑失败');
|
|
}
|
|
|
|
return sendSuccessArray();
|
|
}
|
|
|
|
|
|
}
|