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
0a549ae7
Commit
0a549ae7
authored
Feb 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门名编辑
parent
12b3e817
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
District.php
application/index/controller/District.php
+8
-1
ADistrict.php
application/model/ADistrict.php
+25
-0
No files found.
application/index/controller/District.php
View file @
0a549ae7
...
@@ -53,12 +53,19 @@ class District extends Basic
...
@@ -53,12 +53,19 @@ class District extends Basic
* 添加部门,绑定总监关系
* 添加部门,绑定总监关系
*
*
* @return \think\Response
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
addDistrict
()
{
public
function
addDistrict
()
{
if
(
$this
->
params
[
'department_name'
]
||
$this
->
params
[
'agents_id'
])
{
if
(
$this
->
params
[
'department_name'
]
||
$this
->
params
[
'agents_id'
])
{
$district
=
new
ADistrict
();
$district
=
new
ADistrict
();
$this
->
data
=
$district
->
addDepartmentAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
if
(
$this
->
request
->
isPost
())
{
$this
->
data
=
$district
->
addDepartmentAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
}
else
{
$this
->
data
=
$district
->
getDistrictById
(
$this
->
params
[
'id'
]);
}
}
else
{
}
else
{
$this
->
code
=
101
;
$this
->
code
=
101
;
$this
->
msg
=
'department or district is null'
;
$this
->
msg
=
'department or district is null'
;
...
...
application/model/ADistrict.php
View file @
0a549ae7
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
namespace
app\model
;
namespace
app\model
;
use
think\Db
;
class
ADistrict
extends
BaseModel
class
ADistrict
extends
BaseModel
{
{
/**
/**
...
@@ -56,4 +58,26 @@ class ADistrict extends BaseModel
...
@@ -56,4 +58,26 @@ class ADistrict extends BaseModel
return
$resutlt
;
return
$resutlt
;
}
}
/**
* 获取部门名和总监
*
* @param $id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getDistrictById
(
$id
)
{
if
(
$id
)
{
$data
[
'district_name'
]
=
$this
->
where
(
'id'
,
$id
)
->
value
(
'district_name'
);
$agents
=
Db
::
table
(
'a_agents'
)
->
field
(
'name,phone'
)
->
where
([
'status'
=>
0
,
'level'
=>
[
'in'
,[
'30,40'
]]])
->
find
();
$data
[
'name'
]
=
$agents
[
'name'
]
.
'-'
.
$agents
[
'phone'
];
}
else
{
$data
=
false
;
}
return
$data
;
}
}
}
\ No newline at end of file
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