cqp hai 1 mes
pai
achega
a0b50b77bf
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/Service/TeamService.php

+ 2 - 2
app/Service/TeamService.php

@@ -196,13 +196,13 @@ class TeamService extends Service
 
 
         if($is_add){
         if($is_add){
             $bool = Team::where('code',$data['code'])
             $bool = Team::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+                ->where('top_depart_id', $user['top_depart_id'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();
         }else{
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
             if(empty($data['id'])) return [false,'ID不能为空'];
             $bool = Team::where('code',$data['code'])
             $bool = Team::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+                ->where('top_depart_id', $user['top_depart_id'])
                 ->where('id','<>',$data['id'])
                 ->where('id','<>',$data['id'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();