Commit 4ccd9f20 authored by clone's avatar clone

1

parent 9e6ef4fb
...@@ -424,7 +424,7 @@ class Broker extends Basic ...@@ -424,7 +424,7 @@ class Broker extends Basic
$params["agent_id"] = $agent_id; $params["agent_id"] = $agent_id;
$field = "id,agent_id,device_id,model,is_forbidden,is_pc,create_time,update_time"; $field = "id,agent_id,device_id,model,is_forbidden,is_pc,create_time,update_time";
$result = $aBD->getDeviceByAgentId($params, $field); $result = $aBD->getDeviceNewByAgentId($params, $field);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "success", $result); return $this->response("200", "success", $result);
} else { } else {
......
...@@ -71,12 +71,23 @@ class ABindingDevice extends BaseModel ...@@ -71,12 +71,23 @@ class ABindingDevice extends BaseModel
if (isset($params["agent_id"])) { if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"]; $where_["agent_id"] = $params["agent_id"];
} }
if (isset($params["device_id"])) {
$where_["device_id"] = $params["device_id"];
}
if (isset($params["is_forbidden"])) {
$where_["is_forbidden"] = $params["is_forbidden"];
}
if (isset($params["is_pc"])) {
$where_["is_pc"] = $params["is_pc"];
}
if (isset($params["push_id"])) {
$where_["push_id"] = $params["push_id"];
}
try { try {
$data = $this $data = $this
->field($field) ->field($field)
->where($where_) ->where($where_)
->order("update_time desc") ->order("create_time desc")
->limit(5)
->select(); ->select();
} catch (\Exception $e) { } catch (\Exception $e) {
$data = []; $data = [];
...@@ -85,7 +96,7 @@ class ABindingDevice extends BaseModel ...@@ -85,7 +96,7 @@ class ABindingDevice extends BaseModel
} }
/** /**
* 根据经纪人id获取绑定过的设备id * 根据经纪人id获取绑定过的设备id pc
* *
* @param array $params * @param array $params
* @param string $field * @param string $field
...@@ -97,23 +108,13 @@ class ABindingDevice extends BaseModel ...@@ -97,23 +108,13 @@ class ABindingDevice extends BaseModel
if (isset($params["agent_id"])) { if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"]; $where_["agent_id"] = $params["agent_id"];
} }
if (isset($params["device_id"])) {
$where_["device_id"] = $params["device_id"];
}
if (isset($params["is_forbidden"])) {
$where_["is_forbidden"] = $params["is_forbidden"];
}
if (isset($params["is_pc"])) {
$where_["is_pc"] = $params["is_pc"];
}
if (isset($params["push_id"])) {
$where_["push_id"] = $params["push_id"];
}
try { try {
$data = $this $data = $this
->field($field) ->field($field)
->where($where_) ->where($where_)
->order("update_time desc") ->order("update_time desc")
->limit(5)
->select(); ->select();
} catch (\Exception $e) { } catch (\Exception $e) {
$data = []; $data = [];
......
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