From 3411c8b129e22a1e1eea7f91054fda9eae148f28 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Sat, 25 Apr 2026 17:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/DistributionLogic.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/logic/DistributionLogic.php b/app/api/logic/DistributionLogic.php index 5a09105d..8c70e4cd 100644 --- a/app/api/logic/DistributionLogic.php +++ b/app/api/logic/DistributionLogic.php @@ -374,11 +374,14 @@ class DistributionLogic extends Logic if($firstLeader->isEmpty()) { throw new \think\Exception('无效的二维码'); } - $user = User::where(['user_id' => $user_id]) + $user = User::where(['id' => $user_id]) ->find(); if($user['first_leader'] != 0) { throw new \think\Exception('已扫码'); } + if($post['user_id'] == $user_id) { + throw new \think\Exception('无法扫自己的码'); + } // 上级 $first_leader_id = $firstLeader['id']; $data = [