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
fd4c9067
Commit
fd4c9067
authored
Jul 17, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户站点
parent
45511a2a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
8 deletions
+119
-8
User.php
application/api_broker/controller/User.php
+0
-0
Member.php
application/index/controller/Member.php
+4
-5
UserAgentService.php
application/index/service/UserAgentService.php
+28
-0
Users.php
application/model/Users.php
+87
-3
No files found.
application/api_broker/controller/User.php
View file @
fd4c9067
This diff is collapsed.
Click to expand it.
application/index/controller/Member.php
View file @
fd4c9067
...
...
@@ -68,7 +68,7 @@ class Member extends Basic{
$can_vip
=
true
;
if
(
!
empty
(
$params
[
'agent_id'
]))
{
// $where['a.agent_id'] = $params['agent_id'];
$c_user
=
new
User
();
$c_user
=
new
User
AgentService
();
$user_id_str
=
$c_user
->
getUserIDList
(
$params
[
'agent_id'
]);
$where
[
'a.id'
]
=
[
'in'
,
$user_id_str
];
$can_vip
=
false
;
...
...
@@ -325,9 +325,9 @@ class Member extends Basic{
$check_data
=
$service_broker
->
checkSite
(
$this
->
userId
,
$this
->
params
[
'site_id'
]);
if
(
$check_data
&&
!
empty
(
$this
->
params
[
'site_id'
]))
{
$where
[
'
a.site_ids'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'site_id'
]
.
'%'
];
$where
[
'
s.site_id'
]
=
$this
->
params
[
'site_id'
];
}
else
{
$where
[
'
a.site_ids'
]
=
[
'LIKE'
,
'%'
.
$this
->
siteId
.
'%'
]
;
$where
[
'
s.site_id'
]
=
$this
->
siteId
;
}
}
...
...
@@ -356,8 +356,7 @@ class Member extends Basic{
}
// big_log(json_encode($where));
$where
[
's.is_del'
]
=
0
;
$fields
=
'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,
a.referrer_id,a.user_label,a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand
,a.user_status,a.source,a.entrust_type,a.concrete_industry'
;
...
...
application/index/service/UserAgentService.php
View file @
fd4c9067
...
...
@@ -251,4 +251,31 @@ class UserAgentService
}
/**
* 查询客方id集合
* @param $agent_id
* @return string
*/
public
function
getUserIDList
(
$agent_id
)
{
//查询总监下面门店的所有经纪人
$params
=
[];
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
"is_del"
]
=
0
;
// $m_user_agent = new UserAgentModel();
$field
=
'user_id'
;
$res
=
$this
->
m_user_agent
->
selectUser
(
$field
,
$params
);
$user_id_str
=
""
;
if
(
count
(
$res
)
>
0
)
{
foreach
(
$res
as
$k
=>
$v
)
{
$user_id_str
.=
$v
[
"user_id"
]
.
","
;
}
$user_id_str
=
rtrim
(
$user_id_str
,
","
);
}
return
$user_id_str
;
}
}
\ No newline at end of file
application/model/Users.php
View file @
fd4c9067
...
...
@@ -118,10 +118,12 @@ class Users extends Model
if
(
$type
==
1
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
// ->group("a.id")
->
select
();
}
elseif
(
$type
==
2
)
{
$result
=
$this
->
field
(
$fields
)
...
...
@@ -138,6 +140,7 @@ class Users extends Model
->
alias
(
'a'
)
->
join
(
"u_user_agent c"
,
"a.id = c.user_id"
,
"left"
)
->
join
(
'a_agents b'
,
'c.agent_id = b.id'
,
'left'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
...
...
@@ -147,6 +150,7 @@ class Users extends Model
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.referrer_id = b.id'
,
'left'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
where
(
'a.referrer_source'
,
20
)
->
order
(
$order_
)
...
...
@@ -154,11 +158,14 @@ class Users extends Model
->
page
(
$pageNo
)
->
select
();
}
else
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
group
(
"a.id"
)
->
select
();
}
return
$result
;
...
...
@@ -685,7 +692,82 @@ class Users extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
=
" id desc"
)
public
function
selectUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
)
{
$params
[
's.is_del'
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
order
(
$order
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
->
select
();
// big_log($this->getLastSql());
return
$result
;
}
/**
* 我的客户
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @param $order
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectUserListGroup
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$params
)
->
order
(
$order
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
->
group
(
"a.id"
)
->
select
();
// big_log($this->getLastSql());
return
$result
;
}
/**
* 我的客户
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @param $order
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectMyUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'a'
)
// ->join("u_user_site s", "a.id=s.user_id", "right")
->
where
(
$params
)
->
order
(
$order
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
// ->group("a.id")
->
select
();
// big_log($this->getLastSql());
return
$result
;
}
/**
* 关联客户-根据id搜索客户
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
bindUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
=
"id desc"
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
...
...
@@ -934,7 +1016,9 @@ class Users extends Model
->
page
(
$page
)
->
select
();
}
else
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
"u_user_site s"
,
"a.id=s.user_id"
,
"right"
)
->
where
(
$where
)
->
order
(
$order
)
->
limit
(
$limit
)
...
...
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