Commit 0e3780f8 authored by clone's avatar clone

bug

parent 253c3f7a
......@@ -167,20 +167,20 @@ class Broker extends Basic
public function verifyAgentStatus()
{
$params = $this->params;
/* $params = array(
"agent_id" => 12,
"device_id" => "123123131"
);*/
/* $params = array(
"agent_id" => 12,
"device_id" => "123123131"
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyAgentStatus");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$is_visit = $this->judgeBand($params["device_id"], $params["agent_id"], "", 1);
if($is_visit){
return $this->response("200","success",[]);
}else{
return $this->response("101","该账号没有绑定该手机,请致电人事进行绑定。");
if ($is_visit) {
return $this->response("200", "success", []);
} else {
return $this->response("101", "该账号没有绑定该手机,请致电人事进行绑定。");
}
}
......@@ -194,8 +194,6 @@ class Broker extends Basic
*/
private function judgeBand(string $device_id, int $agent_id, string $model, int $type): bool
{
//todo 查询是否绑定过设备id,if没有绑定则直接登陆新增绑定关系,if有绑定,则判断登陆的设备id是否存在于关系列表中,存在并且状态正常则登陆,
//todo 否则提示联系管理员开通
$aBD = new ABindingDevice();
$params["agent_id"] = $agent_id;
......@@ -211,10 +209,11 @@ class Broker extends Basic
if ($device_id == $item["device_id"] && $item["is_forbidden"] == 0) {
return true;
}
if ($device_id == $item["device_id"] && $item["is_forbidden"] == 1 && $type == 0) {
//新增申请绑定关系
$aBD->addDevice([ "device_id" => $device_id, "agent_id" => $agent_id, "model" => $model, "is_forbidden" => 1 ]);
}
}
//新增申请绑定关系
if ($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