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
8d7b4b43
Commit
8d7b4b43
authored
Apr 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量修改独家方
parent
8ccd4a14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
Houses.php
application/index/controller/Houses.php
+40
-0
GHousesToAgents.php
application/model/GHousesToAgents.php
+27
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Houses.php
View file @
8d7b4b43
...
@@ -13,6 +13,7 @@ use app\api\controller\Sublet;
...
@@ -13,6 +13,7 @@ use app\api\controller\Sublet;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\SubletModel
;
use
app\model\SubletModel
;
use
think\Request
;
use
think\Request
;
...
@@ -306,4 +307,42 @@ class Houses extends Basic
...
@@ -306,4 +307,42 @@ class Houses extends Basic
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
/**
* 批量修改独家方
*
* @return \think\Response
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
batchChangDish
()
{
if
(
empty
(
$this
->
params
[
'old_agents_id'
])
||
empty
(
$this
->
params
[
'agents_id'
]))
{
return
$this
->
response
(
101
,
'盘方信息错误'
);
}
$agent
=
new
GHousesToAgents
();
$agent
->
startTrans
();
$agent
->
lock
(
true
);
$where
[
'type'
]
=
2
;
$where
[
'b.id'
]
=
$this
->
params
[
'old_agents_id'
];
$agent_house
=
$agent
->
getHouseAgent
(
'a.id'
,
$where
);
$agent_data_arr
=
[];
if
(
count
(
$agent_house
)
>
0
)
{
$agent_data_arr
=
[];
foreach
(
$agent_house
as
$k
=>
$v
)
{
$agent_data_arr
[
$k
][
'id'
]
=
$v
[
'id'
];
$agent_data_arr
[
$k
][
'agents_id'
]
=
$this
->
params
[
'agents_id'
];
}
}
$total
=
$agent
->
updateUserAll
(
$agent_data_arr
);
$agent
->
commit
();
return
$this
->
response
(
200
,
''
,
[
'total'
=>
count
(
$total
)]);
}
}
}
\ No newline at end of file
application/model/GHousesToAgents.php
View file @
8d7b4b43
...
@@ -236,4 +236,31 @@ class GHousesToAgents extends BaseModel
...
@@ -236,4 +236,31 @@ class GHousesToAgents extends BaseModel
->
where
(
'type'
,
$type
)
->
where
(
'type'
,
$type
)
->
select
();
->
select
();
}
}
/**
* 获取楼盘与经纪人关系
*
* @param string $field
* @param array $where
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseAgent
(
string
$field
=
''
,
array
$where
=
[])
:
array
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
/**
* @param $data
* @return array|false
* @throws \Exception
*/
public
function
updateUserAll
(
$data
)
{
return
$this
->
saveAll
(
$data
);
}
}
}
application/route.php
View file @
8d7b4b43
...
@@ -98,6 +98,7 @@ Route::group('index', [
...
@@ -98,6 +98,7 @@ Route::group('index', [
'addHousesAgentsExclusive'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系(独家)
'addHousesAgentsExclusive'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系(独家)
'delTohouses'
=>
[
'index/broker/delTohouses'
,
[
'method'
=>
'POST'
]],
//解除经纪人和楼盘关系
'delTohouses'
=>
[
'index/broker/delTohouses'
,
[
'method'
=>
'POST'
]],
//解除经纪人和楼盘关系
'getAgentsTohouses'
=>
[
'index/broker/getAgentsTohouses'
,
[
'method'
=>
'GET'
]],
//获取经纪人和楼盘关系信息
'getAgentsTohouses'
=>
[
'index/broker/getAgentsTohouses'
,
[
'method'
=>
'GET'
]],
//获取经纪人和楼盘关系信息
'batchChangDish'
=>
[
'index/houses/batchChangDish'
,
[
'method'
=>
'post'
]
],
//批量修改盘方
//版本管理
//版本管理
'version'
=>
[
'index/version/index'
,[
'method'
=>
'get'
]],
'version'
=>
[
'index/version/index'
,[
'method'
=>
'get'
]],
...
@@ -209,6 +210,7 @@ Route::group('index', [
...
@@ -209,6 +210,7 @@ Route::group('index', [
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'method'
=>
'post|get'
]
],
//收款记录
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'method'
=>
'post|get'
]
],
//收款记录
]);
]);
...
...
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