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
f81cb015
Commit
f81cb015
authored
Aug 07, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
4e889a49
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
User.php
application/api_broker/controller/User.php
+8
-3
Users.php
application/model/Users.php
+2
-2
No files found.
application/api_broker/controller/User.php
View file @
f81cb015
...
@@ -150,6 +150,7 @@ class User extends Basic
...
@@ -150,6 +150,7 @@ class User extends Basic
{
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$this
->
city
=
'上海市'
;
/*$params = array(
/*$params = array(
"user_id" => 3,
"user_id" => 3,
"agent_id" => 9,
"agent_id" => 9,
...
@@ -165,13 +166,16 @@ class User extends Basic
...
@@ -165,13 +166,16 @@ class User extends Basic
$where
[
'city'
]
=
trim
(
$this
->
city
);
$where
[
'city'
]
=
trim
(
$this
->
city
);
if
(
$params
[
'type'
]
==
'last'
){
if
(
$params
[
'type'
]
==
'last'
){
$where
[
'id'
]
=
[
'gt'
,
$params
[
'user_id'
]];
$where
[
'id'
]
=
[
'gt'
,
$params
[
'user_id'
]];
$order
=
'id asc'
;
}
else
{
}
else
{
$where
[
'id'
]
=
[
'lt'
,
$params
[
'user_id'
]];
$where
[
'id'
]
=
[
'lt'
,
$params
[
'user_id'
]];
$order
=
'id desc'
;
}
}
//dump($where);
//dump($where);
$field
=
'id,user_nick,agent_id,vip'
;
$field
=
'id,user_nick,agent_id,vip'
;
$user
=
new
Users
();
$user
=
new
Users
();
$user_res
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
1
);
$user_res
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
1
,
$order
);
if
(
!
$user_res
){
if
(
!
$user_res
){
return
$this
->
response
(
"200"
,
"不符合条件0"
,
[]);
return
$this
->
response
(
"200"
,
"不符合条件0"
,
[]);
}
}
...
@@ -191,9 +195,10 @@ class User extends Basic
...
@@ -191,9 +195,10 @@ class User extends Basic
$where
=
[];
$where
=
[];
$where
[
'city'
]
=
trim
(
$this
->
city
);
$where
[
'city'
]
=
trim
(
$this
->
city
);
$field
=
'max(id) as max_id'
;
$field
=
'max(id) as max_id'
;
$max_id
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
''
);
$order
=
'id asc'
;
$max_id
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
''
,
$order
);
$field
=
'MIN(id) as min_id'
;
$field
=
'MIN(id) as min_id'
;
$min_id
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
''
);
$min_id
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
''
,
$order
);
return
$this
->
response
(
"200"
,
"success!"
,
[
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_id'
=>
$user_res
[
0
][
'id'
],
'user_id'
=>
$user_res
[
0
][
'id'
],
'max_user_id'
=>
$max_id
[
0
][
'max_id'
],
'max_user_id'
=>
$max_id
[
0
][
'max_id'
],
...
...
application/model/Users.php
View file @
f81cb015
...
@@ -748,14 +748,14 @@ class Users extends Model
...
@@ -748,14 +748,14 @@ class Users extends Model
}
}
public
function
getLastOrNextUserID
(
$where
,
$field
,
$limit
)
public
function
getLastOrNextUserID
(
$where
,
$field
,
$limit
,
$order
)
{
{
$return
=
Db
::
name
(
$this
->
table
)
$return
=
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
field
(
$field
)
->
where
(
$where
)
->
where
(
$where
)
->
limit
(
$limit
)
->
limit
(
$limit
)
->
order
(
'id asc'
)
->
order
(
$order
)
->
select
();
->
select
();
//dump($this->getLastSql());
//dump($this->getLastSql());
return
$return
;
return
$return
;
...
...
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