wangsaitao il y a 10 mois
Parent
commit
3015686b60
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      application/api/controller/screen/User.php

+ 4 - 1
application/api/controller/screen/User.php

@@ -79,8 +79,11 @@ class User extends Index
         $data =  Db::name('user_dep')
             ->alias('ud')
             ->join('user u','u.id=ud.user_id')
-            ->join('dep dp','ud.dep_id=dp.id')
+            ->join('dep dp','dp.id=ud.dep_id')
             ->where('u.del',0)
+            ->where('dp.del',0)
+            ->where('dp.enable',1)
+            ->where('dp.org_id',$this->orgId)
             ->field('count(ud.user_id) as value,dp.title as name')
             ->group('ud.dep_id')
             ->order('value','desc')