|
@@ -92,12 +92,18 @@ class Patrol extends Index
|
|
|
}
|
|
|
HelpHander::success($data);
|
|
|
}
|
|
|
+
|
|
|
public function newData(){
|
|
|
- $count1 = Db::name('address')
|
|
|
- ->where('org_id',$this->orgId)
|
|
|
- ->where('enable',1)
|
|
|
- ->where('','exp',Db::raw("FIND_IN_SET(3,types)"))
|
|
|
- ->count();
|
|
|
+ $map[] = ['cate_id','in',[22,23]];
|
|
|
+ $map[] = ['del','=',0];
|
|
|
+ $map[] = ['enable','=',1];
|
|
|
+ $map[] = ['org_id','=',$this->orgId];
|
|
|
+ $count1 = Db::name('device')->where($map)->count();
|
|
|
+// $count1 = Db::name('address')
|
|
|
+// ->where('org_id',$this->orgId)
|
|
|
+// ->where('enable',1)
|
|
|
+// ->where('','exp',Db::raw("FIND_IN_SET(3,types)"))
|
|
|
+// ->count();
|
|
|
$count2 = Db::name('patrol_task')
|
|
|
->alias('pr')
|
|
|
->leftJoin('patrol_task_addr b','pr.id=b.patrol_task_id')
|
|
@@ -107,19 +113,34 @@ class Patrol extends Index
|
|
|
->where('pr.create_yyyymmdd',date('Ymd'))
|
|
|
->group('b.address_id')
|
|
|
->count();
|
|
|
+// $count3 = Db::name('user')
|
|
|
+// ->alias('u')
|
|
|
+// ->join('user_roles ur','u.id=ur.user_id')
|
|
|
+// ->where('u.del',0)
|
|
|
+// ->where('ur.roles_id','in',[464,465,466])
|
|
|
+// ->count();
|
|
|
$count3 = Db::name('user')
|
|
|
->alias('u')
|
|
|
->join('user_roles ur','u.id=ur.user_id')
|
|
|
->where('u.del',0)
|
|
|
- ->where('ur.roles_id','in',[464,465,466])
|
|
|
- ->count();
|
|
|
- $count4 = Db::name('user')
|
|
|
- ->alias('u')
|
|
|
- ->join('user_roles ur','u.id=ur.user_id')
|
|
|
- ->where('u.del',0)
|
|
|
->where('work',1)
|
|
|
->where('ur.roles_id','in',[464,465,466])
|
|
|
->count();
|
|
|
+// $count4 = Db::name('user')
|
|
|
+// ->alias('u')
|
|
|
+// ->join('user_roles ur','u.id=ur.user_id')
|
|
|
+// ->where('u.del',0)
|
|
|
+// ->where('work',1)
|
|
|
+// ->where('ur.roles_id','in',[464,465,466])
|
|
|
+// ->count();
|
|
|
+ $count4 = Db::name('device_record')
|
|
|
+ ->alias('a')
|
|
|
+ ->join('device b','a.device_id = b.id')
|
|
|
+ ->where('b.cate_id','in',[22,23])
|
|
|
+ ->where('a.org_id',$this->orgId)
|
|
|
+ ->where('a.create_yyyymm',date("Ym"))
|
|
|
+ ->count();
|
|
|
+
|
|
|
$task = Db::name('patrol_task')
|
|
|
->where('org_id',$this->orgId)
|
|
|
->where('del',0)
|