底层代码优化及用户管理

This commit is contained in:
Ghost
2025-03-29 17:01:56 +08:00
parent a734ae2864
commit 6ec2ceefc5
9 changed files with 155 additions and 16 deletions

View File

@@ -68,6 +68,7 @@ class WechatFriendController extends BaseController
private function saveFriend($item)
{
$data = [
'id' => $item['id'],
'wechatAccountId' => $item['wechatAccountId'],
'alias' => $item['alias'],
'wechatId' => $item['wechatId'],
@@ -106,11 +107,7 @@ class WechatFriendController extends BaseController
];
// 使用三个字段的组合作为唯一性判断
$friend = WechatFriendModel::where([
['ownerWechatId', '=', $item['ownerWechatId']],
['wechatId', '=', $item['wechatId']],
['wechatAccountId', '=', $item['wechatAccountId']]
])->find();
$friend = WechatFriendModel::where('id',$item['id'])->find();
if ($friend) {
$friend->save($data);