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
4bd7e050
Commit
4bd7e050
authored
Feb 05, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加部门,绑定总监关系
parent
937a5421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
2 deletions
+70
-2
Broker.php
application/index/controller/Broker.php
+21
-2
ADistrict.php
application/model/ADistrict.php
+49
-0
No files found.
application/index/controller/Broker.php
View file @
4bd7e050
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ADistrict
;
use
app\model\Agents
;
use
app\model\Agents
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
...
@@ -171,7 +172,7 @@ class Broker extends Basic
...
@@ -171,7 +172,7 @@ class Broker extends Basic
}
}
/**
/**
* 总监列表
*
部门
总监列表
*
*
* @return \think\Response
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
...
@@ -200,9 +201,26 @@ class Broker extends Basic
...
@@ -200,9 +201,26 @@ class Broker extends Basic
}
}
/**
/**
* 总监列表页面
*
部门
总监列表页面
*/
*/
public
function
districtList
()
{
public
function
districtList
()
{
return
view
(
'agent/district'
);
return
view
(
'agent/district'
);
}
}
/**
* 添加部门,绑定总监关系
*
* @return \think\Response
* @throws \think\exception\PDOException
*/
public
function
addDistrict
()
{
if
(
$this
->
params
[
'department_name'
]
||
$this
->
params
[
'agents_id'
])
{
$district
=
new
ADistrict
();
$this
->
data
=
$district
->
addDepartmentAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'department or district is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
}
\ No newline at end of file
application/model/ADistrict.php
0 → 100644
View file @
4bd7e050
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/2/2
* Time: 14:28
*/
namespace
app\model
;
class
ADistrict
extends
BaseModel
{
/**
* 添加部门,绑定总监关系
*
* @param $data
* @param $agents_id
* @return bool
* @throws \think\exception\PDOException
*/
public
function
addDepartmentAgents
(
$data
,
$agents_id
)
{
$this
->
startTrans
();
$date
=
date
(
'Y-m-d H:i:s'
);
$this
->
save
([
'district_name'
=>
$data
[
'department_name'
],
'create_time'
=>
$date
]);
if
(
$this
->
id
)
{
$agents
=
new
AAgents
();
$agents_edit
=
$agents
->
save
([
'district_id'
=>
$this
->
id
],[
'id'
=>
$agents_id
]);
if
(
$agents_edit
)
{
$resutlt
=
$this
->
id
;
$this
->
commit
();
}
else
{
$resutlt
=
false
;
$this
->
rollback
();
}
}
else
{
$resutlt
=
false
;
$this
->
rollback
();
}
return
$resutlt
;
}
}
\ 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