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
6aa9b1d2
Commit
6aa9b1d2
authored
Jan 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断引荐人来源
parent
d6c288de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Member.php
application/index/controller/Member.php
+1
-1
Users.php
application/model/Users.php
+11
-4
No files found.
application/index/controller/Member.php
View file @
6aa9b1d2
...
@@ -59,7 +59,7 @@ class Member extends Basic{
...
@@ -59,7 +59,7 @@ class Member extends Basic{
$where
[
'a.id'
]
=
$params
[
'id'
];
$where
[
'a.id'
]
=
$params
[
'id'
];
}
}
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id'
;
$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
,
''
,
$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 @
6aa9b1d2
...
@@ -47,7 +47,7 @@ class Users extends Model
...
@@ -47,7 +47,7 @@ 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
();
if
(
$params
[
'phone'
])
{
if
(
$params
[
'phone'
])
{
$result
=
$this
->
field
(
$fields
)
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
alias
(
'a'
)
...
@@ -76,9 +76,16 @@ class Users extends Model
...
@@ -76,9 +76,16 @@ class Users extends Model
$data
[
$k
][
'user_pic'
]
=
''
;
$data
[
$k
][
'user_pic'
]
=
''
;
}
}
$agent_data
=
$agents
->
field
(
'realname,phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
//判断来源
$data
[
$k
][
'realname'
]
=
$agent_data
->
realname
;
if
(
$data
[
$k
][
'referrer_source'
]
==
10
)
{
$data
[
$k
][
'phone'
]
=
$agent_data
->
phone
;
$user_data
=
$this
->
field
(
'id,user_nick,user_phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
$data
[
$k
][
'realname'
]
=
$user_data
->
user_nick
;
$data
[
$k
][
'phone'
]
=
$user_data
->
user_phone
;
}
else
{
$agent_data
=
$agents
->
field
(
'realname,phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
$data
[
$k
][
'realname'
]
=
$agent_data
->
realname
;
$data
[
$k
][
'phone'
]
=
$agent_data
->
phone
;
}
}
}
return
$data
;
return
$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