likang %!s(int64=2) %!d(string=hai) anos
pai
achega
cf6d56e670
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      catch/tag_history/controller/TagHistory.php

+ 5 - 1
catch/tag_history/controller/TagHistory.php

@@ -35,6 +35,7 @@ class TagHistory extends CatchController
         $endtime = isset($data['endtime']) ? $data['endtime'] : "";
         $meter = isset($data['meter']) ? $data['meter'] : "";
         $where = [];
+        $onewhere=[];
         $create_id = $request->user()->id;
         //爬楼梯
         $manage = Db::name('user_has_roles')->where('uid', $create_id)->where('role_id', 2)->find();
@@ -121,13 +122,16 @@ class TagHistory extends CatchController
                 ['mac', '=', $value['mac']],
                 ['lable', '=', $value['lable']]
             ];
-
+            //上报时间
             $value['addTime'] = $this->tagHistoryModel->
                where($towwhere)->max('addTime');
             
             $list[$key]['addTime'] = $value['addTime'];
+            
             $value['ave_rssi']= $this->tagHistoryModel->where($towwhere)->where($onewhere)->avg('rssi');
             $list[$key]['ave_rssi'] =  $value['ave_rssi'];
+            var_dump($onewhere);
+
             $value['num']=$this->tagHistoryModel->where($onewhere)->where($towwhere)->count();
             $list[$key]['num'] = $value['num'];
             $wheres = [];