浏览代码

摄像头状态历史数据

任敬轩 1 年之前
父节点
当前提交
a8b9b4a0d3
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Console/Commands/CameraStatusHistory.php

+ 2 - 2
app/Console/Commands/CameraStatusHistory.php

@@ -64,8 +64,8 @@ class CameraStatusHistory extends Command
         $nm['mine_code'] = $ningmei[0]->slug;
         $nm['total'] = DB::table('camera_list')->whereIn('mine_id',$mine_ningmei)->where('deleted_at',null)->count();
         $nm['total_online'] = DB::table('camera_list')->whereIn('mine_id',$mine_ningmei)->where('camera_status',1)->where('deleted_at',null)->count();
-        $nm['total_offline'] = $ningmei['total'] - $ningmei['total_online'];
-        $nm['rate'] = round($ningmei['total_online'] / $ningmei['total'] * 100,2);
+        $nm['total_offline'] = $nm['total'] - $nm['total_online'];
+        $nm['rate'] = round($nm['total_online'] / $nm['total'] * 100,2);
         $nm['type'] = 0;
         $nm['date'] = date('Y-m-d');
         DB::table('camera_status_history')->insert($nm);