cqpCow 1 рік тому
батько
коміт
1dc843d90f
2 змінених файлів з 4 додано та 3 видалено
  1. 2 2
      app/Model/SeeRange.php
  2. 2 1
      app/Service/RangeService.php

+ 2 - 2
app/Model/SeeRange.php

@@ -35,8 +35,8 @@ class SeeRange extends Model
     const data_two = 2; // 人
     const data_three = 3; // 公司
     public static $data_type = [
-        self::type_one,
-        self::type_two,
+        self::data_one,
+        self::data_two,
         self::data_three,
     ];
 }

+ 2 - 1
app/Service/RangeService.php

@@ -106,8 +106,9 @@ class RangeService extends Service
         $depart_id = $user['depart_range'];
         $type = SeeRange::data_two;
         $type2 = [SeeRange::data_one,SeeRange::data_three];
+        $type2 = implode(',',$type2);
         $depart_str = implode(',',$depart_id);
-        $str = "(param_id = $user_id AND type = $type) OR (data_id IN({$depart_str}) AND type = {$type2})";
+        $str = "(param_id = $user_id AND type = $type) OR (data_id IN({$depart_str}) AND type IN ({$type2}))";
 
         // 可见部门 可见人 可以看见
         $data_id = SeeRange::where('del_time',0)