|
@@ -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')
|