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
f6209d6b
Commit
f6209d6b
authored
May 10, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除无门店和部门的经纪人
parent
04d358b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
Agent.php
application/index/controller/Agent.php
+15
-11
No files found.
application/index/controller/Agent.php
View file @
f6209d6b
...
...
@@ -278,11 +278,26 @@ class Agent extends Basic
$table2
=
new
Agents
();
$field
=
'id,device_id,father_id,role_id,level,realname,phone,password,sex,head_portrait,inuse,created,modified,is_inside'
;
$where
[
'level'
]
=
[
'in'
,
'2,5'
];
$where
[
'father_id'
]
=
[
'<>'
,
0
];
$list
=
$table2
->
field
(
$field
)
->
where
(
$where
)
->
select
();
$li
=
collection
(
$list
)
->
toArray
();
//转化arr
$data
=
array
();
foreach
(
$li
as
$k
=>
$v
){
/*******************************************************************/
$district_id
=
Db
::
table
(
"a_district"
)
->
field
(
'id'
)
->
where
(
"agent_id in(select agent_id from chiefs_agents where sub_agent_id='
{
$v
[
'father_id'
]
}
')"
)
->
value
();
if
(
$district_id
){
$data
[
$k
][
'district_id'
]
=
$district_id
;
/*部门Id 对应部门表*/
}
else
{
continue
;
$data
[
$k
][
'district_id'
]
=
0
;
/*部门Id 对应部门表*/
}
/*******************************************************************/
$data
[
$k
][
'id'
]
=
$v
[
'id'
];
/* '经济人表'*/
$data
[
$k
][
'device_id'
]
=
$v
[
'device_id'
];
/* '设备id'*/
$data
[
$k
][
'store_id'
]
=
$v
[
'father_id'
];
/* '门店id关联门店表'*/
...
...
@@ -308,17 +323,6 @@ class Agent extends Basic
default
:/*
默认权限
*/
$data
[
$k
][
'auth_group_id'
]
=
7
;
}
/*******************************************************************/
$district_id
=
Db
::
table
(
"a_district"
)
->
field
(
'id'
)
->
where
(
"agent_id in(select agent_id from chiefs_agents where sub_agent_id='
{
$v
[
'father_id'
]
}
')"
)
->
value
();
if
(
$district_id
){
$data
[
$k
][
'district_id'
]
=
$district_id
;
/*部门Id 对应部门表*/
}
else
{
$data
[
$k
][
'district_id'
]
=
0
;
/*部门Id 对应部门表*/
}
/*******************************************************************/
/************************级别****************************************/
if
(
$v
[
'level'
]
==
2
){
...
...
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