From ad8477d3ee82a3fffd5de4cd60a237c9ee6b1fb7 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Wed, 04 Mar 2026 14:27:05 +0800
Subject: [PATCH] 后台添加供需求发布
---
admin/app/common/model/plus/release/ChatRelation.php | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/admin/app/common/model/plus/release/ChatRelation.php b/admin/app/common/model/plus/release/ChatRelation.php
index bbaa6f8..dfdd789 100644
--- a/admin/app/common/model/plus/release/ChatRelation.php
+++ b/admin/app/common/model/plus/release/ChatRelation.php
@@ -34,6 +34,11 @@
*/
public static function getRelationId($user_id,$other_user_id)
{
+ // 防止自己与自己创建关系
+ if ($user_id == $other_user_id) {
+ return 0;
+ }
+
$model = new static;
$data = $model->where("user_id",'=',$user_id)->where("other_user_id",'=',$other_user_id)->find();
if(empty($data)){
--
Gitblit v1.9.2