Commit 4ccd9f20 authored by clone's avatar clone

1

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