diff --git a/catch/wechat/repository/WechatUsersRepository.php b/catch/wechat/repository/WechatUsersRepository.php index 90a1ff7..b6f6a24 100644 --- a/catch/wechat/repository/WechatUsersRepository.php +++ b/catch/wechat/repository/WechatUsersRepository.php @@ -101,7 +101,8 @@ class WechatUsersRepository extends CatchRepository */ public function tag($id, $data) { - $tagIds = WechatTags::whereIn('name', Utils::stringToArrayBy($data['tag']))->column('tag_id'); + $tagIds = Utils::stringToArrayBy($data['tag']); + // WechatTags::whereIn('name', Utils::stringToArrayBy($data['tag']))->column('tag_id'); $user = $this->findBy($id); @@ -134,6 +135,10 @@ class WechatUsersRepository extends CatchRepository $user->hasTags()->saveAll($attachIds); } + WechatUsers::where('id', $id)->update([ + 'tagid_list' => $data['tag'], + ]); + return true; } } \ No newline at end of file