From 1d90451b4eca85a858566dc5e0c098724f615a7a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 12 Dec 2022 21:02:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20mac=E5=9C=B0=E5=9D=80=E5=B7=B2=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/UserCheckinMac.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/UserCheckinMac.php b/app/Models/UserCheckinMac.php index c18789d42..7b2288e50 100644 --- a/app/Models/UserCheckinMac.php +++ b/app/Models/UserCheckinMac.php @@ -3,6 +3,7 @@ namespace App\Models; +use App\Exceptions\ApiException; use App\Module\Base; /** @@ -39,6 +40,9 @@ class UserCheckinMac extends AbstractModel $ids = []; $list = []; foreach ($array as $item) { + if (self::whereMac($item['mac'])->where('userid', '!=', $userid)->exists()) { + throw new ApiException("{$item['mac']} 已被其他成员设置"); + } $update = []; if ($item['remark']) { $update = [