From 283f4510e1328ee430419718f9fd08cdbce6a5ca Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Thu, 2 Jun 2022 10:03:30 +0800 Subject: [PATCH] agent --- app/Models/Agent.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/Agent.php b/app/Models/Agent.php index 8d4be55b..6cc806d8 100644 --- a/app/Models/Agent.php +++ b/app/Models/Agent.php @@ -24,4 +24,9 @@ class Agent extends Model { return $this->hasMany(User::class, 'agent_id'); } + + public function hasUser() + { + return $this->users()->exists(); + } }