好友/群聊迁移优化

This commit is contained in:
wong
2025-11-28 16:04:29 +08:00
parent 5691d78004
commit 0244871fc1
2 changed files with 24 additions and 23 deletions

View File

@@ -84,25 +84,25 @@ class DataProcessing extends BaseController
if (!empty($wechatFriendId)){
$dsta = WechatFriendModel::where(['id' => $wechatFriendId,'wechatAccountId' => $wechatAccountId])->find();
$data = WechatFriendModel::where(['id' => $wechatFriendId,'wechatAccountId' => $wechatAccountId])->find();
$msg = '好友转移成功';
if(empty($ddta)){
if(empty($data)){
return ResponseHelper::error('好友不存在');
}
}
if (!empty($wechatChatroomId)){
$dsta = WechatChatroomModel::where(['id' => $wechatChatroomId,'wechatAccountId' => $wechatAccountId])->find();
$data = WechatChatroomModel::where(['id' => $wechatChatroomId,'wechatAccountId' => $wechatAccountId])->find();
$msg = '群聊转移成功';
if(empty($ddta)){
if(empty($data)){
return ResponseHelper::error('群聊不存在');
}
}
$dsta->accountId = $toAccountId;
$dsta->updateTime = time();
$dsta->save();
$data->accountId = $toAccountId;
$data->updateTime = time();
$data->save();
break;
case 'CmdNewMessage':
if(empty($friendMessage) && empty($chatroomMessage)){