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
2dd85350
Commit
2dd85350
authored
Jan 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过手机号搜索推荐人
parent
62d37372
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
Member.php
application/index/controller/Member.php
+3
-2
Users.php
application/model/Users.php
+11
-4
No files found.
application/index/controller/Member.php
View file @
2dd85350
...
@@ -52,7 +52,8 @@ class Member extends Basic{
...
@@ -52,7 +52,8 @@ class Member extends Basic{
}
}
if
(
!
empty
(
$params
[
'invite'
]))
{
if
(
!
empty
(
$params
[
'invite'
]))
{
$where
[
'phone'
]
=
$params
[
'invite'
];
$where
[
'user_phone'
]
=
[
'like'
,
$params
[
'invite'
]
.
'%'
];
$where
[
'invite'
]
=
1
;
}
}
if
(
!
empty
(
$params
[
'id'
]))
{
if
(
!
empty
(
$params
[
'id'
]))
{
...
@@ -60,7 +61,7 @@ class Member extends Basic{
...
@@ -60,7 +61,7 @@ class Member extends Basic{
}
}
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.referrer_source'
;
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.referrer_source'
;
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
''
,
$fields
,
$where
);
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
'
a.id DESC
'
,
$fields
,
$where
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
}
}
...
...
application/model/Users.php
View file @
2dd85350
...
@@ -47,12 +47,16 @@ class Users extends Model
...
@@ -47,12 +47,16 @@ class Users extends Model
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getUserAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$fields
=
'*'
,
$params
=
''
)
{
public
function
getUserAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$fields
=
'*'
,
$params
=
''
)
{
$data
=
array
();
$data
=
array
();
if
(
$params
[
'phone'
])
{
if
(
$params
[
'invite'
])
{
unset
(
$params
[
'invite'
]);
$id
=
$this
->
field
(
'id'
)
->
where
(
'user_phone'
,
'LIKE'
,
$params
[
'user_phone'
][
'1'
]
.
'%'
)
->
find
();
unset
(
$params
[
'user_phone'
]);
$result
=
$this
->
field
(
$fields
)
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.referrer_id=b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
where
(
'referrer_id'
,
'='
,
$id
->
id
)
->
order
(
$order_
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
...
@@ -97,10 +101,13 @@ class Users extends Model
...
@@ -97,10 +101,13 @@ class Users extends Model
* @return mixed
* @return mixed
*/
*/
public
function
getUserAgentTotal
(
$params
)
{
public
function
getUserAgentTotal
(
$params
)
{
if
(
$params
[
'phone'
])
{
if
(
$params
[
'invite'
])
{
unset
(
$params
[
'invite'
]);
$id
=
$this
->
field
(
'id'
)
->
where
(
'user_phone'
,
'LIKE'
,
$params
[
'user_phone'
][
'1'
]
.
'%'
)
->
find
();
unset
(
$params
[
'user_phone'
]);
$result
=
$this
->
alias
(
'a'
)
$result
=
$this
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.referrer_id=b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
where
(
'referrer_id'
,
'='
,
$id
->
id
)
->
count
();
->
count
();
}
else
{
}
else
{
$result
=
$this
->
alias
(
'a'
)
$result
=
$this
->
alias
(
'a'
)
...
...
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