Pārlūkot izejas kodu

设备管理接口

任敬轩 3 mēneši atpakaļ
vecāks
revīzija
cd0aecae9d
1 mainītis faili ar 31 papildinājumiem un 16 dzēšanām
  1. 31 16
      Modules/Admin/Http/Controllers/Api/ApiController.php

+ 31 - 16
Modules/Admin/Http/Controllers/Api/ApiController.php

@@ -512,30 +512,45 @@ class ApiController extends BaseController
                 $result['data'] = 1;//有权限
             }
         }else{
-            $people_list = DB::connection('mysql_fwe10')->table('uf_uf_zhxx_sbgl')->where('id',$id)->get();
-            if($type == 'xsbdhfzr' && $staff_num == $people_list[0]->xsbdhfzr){
-                $result = 1;
+            $sb = DB::connection('mysql_fwe10')->table('uf_uf_zhxx_sbgl')->where('id',$id)->get();
+            if($type == 'xsbdhfzr'){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->xsbdhfzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
-            if($type == 'dxfzr' && $staff_num == $people_list[0]->dxfzr){
-                $result = 1;
+            if($type == 'dxfzr' && $staff_num == $sb[0]->dxfzr){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->dxfzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
-            if($type == 'jxfzr' && $staff_num == $people_list[0]->jxfzr){
-                $result = 1;
+            if($type == 'jxfzr' && $staff_num == $sb[0]->jxfzr){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->jxfzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
-            if($type == 'jxysfzr' && $staff_num == $people_list[0]->jxysfzr){
-                $result = 1;
+            if($type == 'jxysfzr' && $staff_num == $sb[0]->jxysfzr){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->jxysfzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
-            if($type == 'dbffzr' && $staff_num == $people_list[0]->dbffzr){
-                $result = 1;
+            if($type == 'dbffzr' && $staff_num == $sb[0]->dbffzr){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->dbffzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
-            if($type == 'bffzr' && $staff_num == $people_list[0]->bffzr){
-                $result = 1;
+            if($type == 'bffzr' && $staff_num == $sb[0]->bffzr){
+                $people = DB::connection('mysql_fwe10')->table('uf_zhxx_sbgl_rygl')->where('id',$sb[0]->bffzr)->get();
+                if($people[0]->gh == $staff_num){
+                    $result['data'] = 1;
+                }
             }
         }
 
-
-
-
         return self::successResponse($result);
     }
 }