Commit bdb06b82 authored by clone's avatar clone

bug

parent 0e3780f8
......@@ -205,15 +205,20 @@ class Broker extends Basic
$aBD->addDevice([ "device_id" => $device_id, "agent_id" => $agent_id, "model" => $model, "is_forbidden" => 0 ]);
return true;
}
$is_exits = false;
foreach ($result as $item) {
if ($device_id == $item["device_id"] && $item["is_forbidden"] == 0) {
return true;
}
if ($device_id == $item["device_id"] && $item["is_forbidden"] == 1 && $type == 0) {
if($device_id == $item["device_id"] && $item["is_forbidden"] == 1){
$is_exits = true;
}
}
if (!$is_exits && $type == 0) {
//新增申请绑定关系
$aBD->addDevice([ "device_id" => $device_id, "agent_id" => $agent_id, "model" => $model, "is_forbidden" => 1 ]);
}
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment