|
@@ -305,19 +305,19 @@ class Api extends CatchController
|
|
|
$beforeKey='station_access_before_data';
|
|
|
$list=$redis->hgetall($hashKey);
|
|
|
foreach($list as $key=>$val){
|
|
|
- $data = json_decode($v, true);
|
|
|
+ $report_data = json_decode($val, true);
|
|
|
if ( (time() - $data["time"] ) > 10 ) {
|
|
|
$before_data=json_decode($redis->hGet($beforeKey,$key),true);
|
|
|
//存在反向数据 并且连续搜到单边数据5次
|
|
|
if($before_data){
|
|
|
//开始推送数据;
|
|
|
$send_data=[
|
|
|
- "mac"=>$val['mac'],
|
|
|
- "label"=>$val['label'],
|
|
|
- 'time'=>$val['time'],
|
|
|
+ "mac"=>$report_data['mac'],
|
|
|
+ "label"=>$report_data['label'],
|
|
|
+ 'time'=>$report_data['time'],
|
|
|
];
|
|
|
|
|
|
- if($val['ant']>$before_data['ant']){
|
|
|
+ if($report_data['ant']>$before_data['ant']){
|
|
|
//1->2 内到外 出
|
|
|
$send_data['dirt']=2;
|
|
|
}else{
|