|
@@ -188,6 +188,12 @@ class Api extends CatchController
|
|
|
$received_state=$redis->hget('api_receiver_asset_state', 'accessClassReport');
|
|
|
$mac=$list['mac'];
|
|
|
foreach($list['data'] as $val){
|
|
|
+ //1 3外 2 4内
|
|
|
+ if($val['ant']=='3'){
|
|
|
+ $val['ant']='1';
|
|
|
+ }elseif($val['ant']=='4'){
|
|
|
+ $val['ant']='2';
|
|
|
+ }
|
|
|
$report_data=[
|
|
|
'mac' => $mac,
|
|
|
'label' =>$val['label'],
|
|
@@ -227,11 +233,11 @@ class Api extends CatchController
|
|
|
];
|
|
|
|
|
|
if($report_data['ant']>$before_data['ant']){
|
|
|
- //1->2 内到外 出
|
|
|
- $send_data['dirt']=2;
|
|
|
- }else{
|
|
|
- //2>1 外到内 进
|
|
|
+ //1->2 外到内 进
|
|
|
$send_data['dirt']=1;
|
|
|
+ }else{
|
|
|
+ //2>1 内到外 出
|
|
|
+ $send_data['dirt']=2;
|
|
|
}
|
|
|
var_dump($send_data);
|
|
|
//推送数据
|
|
@@ -319,11 +325,11 @@ class Api extends CatchController
|
|
|
];
|
|
|
|
|
|
if($report_data['ant']>$before_data['ant']){
|
|
|
- //1->2 内到外 出
|
|
|
- $send_data['dirt']=2;
|
|
|
- }else{
|
|
|
- //2>1 外到内 进
|
|
|
+ //1->2 外到内 进
|
|
|
$send_data['dirt']=1;
|
|
|
+ }else{
|
|
|
+ //2>1 内到外 出
|
|
|
+ $send_data['dirt']=2;
|
|
|
}
|
|
|
var_dump($send_data);
|
|
|
//推送数据
|