|
@@ -113,11 +113,33 @@ class TagHistory extends CatchController
|
|
|
|
|
|
foreach ($list as $key => $value) {
|
|
|
$wheres = [];
|
|
|
+ $wh = [];
|
|
|
$da = null;
|
|
|
$wheres[] = ['mac', '=', $value['mac']];
|
|
|
$wheres[] = ['lable', '=', $value['lable']];
|
|
|
$wheres[] = ['addTime', '=', $value['addTime']];
|
|
|
- $da = $this->tagHistoryModel->where($wheres)->find();
|
|
|
+ $da = $this->tagHistoryModel->where($wheres)->find();
|
|
|
+
|
|
|
+ $wh =[
|
|
|
+ ['mac', '=', $value['mac']],
|
|
|
+ ['lable', '=', $value['lable']],
|
|
|
+ ['addTime', '<', $value['addTime']]
|
|
|
+ ];
|
|
|
+
|
|
|
+ $list[$key]['status']=1;
|
|
|
+ //1 在线 0 离线
|
|
|
+ if($shifouRole)
|
|
|
+ {
|
|
|
+ $time = $this->tagHistoryModel->where($wh)->order('addTime','desc')->value('addTime');
|
|
|
+ if(($value['addTime']-$time)<=90)
|
|
|
+ {
|
|
|
+ $list[$key]['status']=0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $list[$key]['status']=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
$list[$key]['rssi'] = $da['rssi'];
|
|
|
$list[$key]['move'] = $da['move'];
|
|
|
$list[$key]['step'] = $da['step'];
|