Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
9e6ef4fb
Commit
9e6ef4fb
authored
Jul 09, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5ec78f1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
ABindingDevice.php
application/model/ABindingDevice.php
+27
-1
No files found.
application/model/ABindingDevice.php
View file @
9e6ef4fb
...
@@ -66,6 +66,32 @@ class ABindingDevice extends BaseModel
...
@@ -66,6 +66,32 @@ class ABindingDevice extends BaseModel
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getDeviceByAgentId
(
array
$params
,
string
$field
=
"id,agent_id,device_id,is_forbidden,model,push_id,is_pc"
)
public
function
getDeviceByAgentId
(
array
$params
,
string
$field
=
"id,agent_id,device_id,is_forbidden,model,push_id,is_pc"
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
try
{
$data
=
$this
->
field
(
$field
)
->
where
(
$where_
)
->
order
(
"update_time desc"
)
->
limit
(
5
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
[];
}
return
$data
;
}
/**
* 根据经纪人id获取绑定过的设备id
*
* @param array $params
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getDeviceNewByAgentId
(
array
$params
,
string
$field
)
{
{
$where_
=
[];
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
if
(
isset
(
$params
[
"agent_id"
]))
{
...
@@ -87,7 +113,7 @@ class ABindingDevice extends BaseModel
...
@@ -87,7 +113,7 @@ class ABindingDevice extends BaseModel
$data
=
$this
$data
=
$this
->
field
(
$field
)
->
field
(
$field
)
->
where
(
$where_
)
->
where
(
$where_
)
->
order
(
"
cre
ate_time desc"
)
->
order
(
"
upd
ate_time desc"
)
->
select
();
->
select
();
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$data
=
[];
$data
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment