cqpCow 1 år sedan
förälder
incheckning
068f7bb7da
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6 1
      app/Service/RangeService.php

+ 6 - 1
app/Service/RangeService.php

@@ -121,7 +121,12 @@ class RangeService extends Service
         $type2 = [SeeRange::data_one,SeeRange::data_three];
         $type2 = implode(',',$type2);
         $depart_str = implode(',',$depart_id);
-        $str = "(param_id = $user_id AND type = $type) OR (param_id IN({$depart_str}) AND type IN ({$type2}))";
+        if(empty($depart_str)) {
+            $string = "param_id = 0";
+        }else{
+            $string = "param_id IN({$depart_str})";
+        }
+        $str = "(param_id = $user_id AND type = $type) OR ($string AND type IN ({$type2}))";
 
         // 可见部门 可见人 可以看见
         $data_id = SeeRange::where('del_time',0)