Browse Source

1.处理老师与客服添加好友

yuanliang 1 year ago
parent
commit
db63d32cce

+ 4 - 6
cooleshow-user/user-biz/src/main/resources/config/mybatis/ImUserFriendMapper.xml

@@ -31,11 +31,9 @@
     <delete id="delFriendByTenantId">
         DELETE t1
         FROM im_user_friend t1
-                 LEFT JOIN teacher t2 ON (
-                    t2.tenant_id_ = #{tenantId} AND
-                    (t1.user_id_ = t2.user_id_ OR t1.friend_id_ = t2.user_id_)
-            )
-        WHERE (t1.user_id_ = #{userId} and t1.client_type_ = #{clientType})
-        OR t1.friend_id_ = #{userId}
+                 LEFT JOIN teacher t2 ON t1.friend_id_ = t2.user_id_
+                 LEFT JOIN teacher t3 ON t1.user_id_ = t3.user_id_
+        WHERE (t1.user_id_ = #{userId} and t1.client_type_ = #{clientType} and t2.tenant_id_ = #{tenantId})
+           OR (t1.friend_id_ = #{userId} and t1.friend_type_ = #{clientType} and t3.tenant_id_ = #{tenantId})
     </delete>
 </mapper>