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
19581628
Commit
19581628
authored
Jun 05, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量修改独家方
parent
ec0a2596
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
4 deletions
+76
-4
OfficeRoom.php
application/index/controller/OfficeRoom.php
+22
-0
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+53
-3
route.php
application/route.php
+1
-1
No files found.
application/index/controller/OfficeRoom.php
View file @
19581628
...
@@ -160,4 +160,25 @@ class OfficeRoom extends Basic
...
@@ -160,4 +160,25 @@ class OfficeRoom extends Basic
}
}
return
$this
->
response
(
$code
,
$msg
,
$data
);
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
/**
* 批量修改独家方
*
* @return \think\Response
*/
public
function
batchChangDish
()
{
$code
=
200
;
$msg
=
''
;
$data
=
[];
$result
=
$this
->
service
->
batchChangDish
(
$this
->
params
[
'old_agents_id'
],
$this
->
params
[
'agents_id'
],
$this
->
userId
);
if
(
$result
[
'status'
]
==
'successful'
)
{
$data
=
$result
[
'data'
];
}
else
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
}
\ No newline at end of file
application/index/service/OfficeRoomService.php
View file @
19581628
...
@@ -35,6 +35,7 @@ class OfficeRoomService
...
@@ -35,6 +35,7 @@ class OfficeRoomService
private
$landlord_phone
;
private
$landlord_phone
;
private
$internet_path
;
private
$internet_path
;
private
$m_building_stations
;
private
$m_building_stations
;
private
$redis_service
;
public
function
__construct
()
public
function
__construct
()
...
@@ -47,7 +48,7 @@ class OfficeRoomService
...
@@ -47,7 +48,7 @@ class OfficeRoomService
$this
->
agent_room
=
new
OfficeGRoomToAgent
();
$this
->
agent_room
=
new
OfficeGRoomToAgent
();
$this
->
landlord_phone
=
new
OfficeGLandlordPhone
();
$this
->
landlord_phone
=
new
OfficeGLandlordPhone
();
$this
->
m_building_stations
=
new
OfficeGBuildingStations
();
$this
->
m_building_stations
=
new
OfficeGBuildingStations
();
$this
->
redis_service
=
new
RedisCacheService
();
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
$this
->
internet_path
=
IMAGES_URL
.
'/resource/lib/Attachments/images/'
;
$this
->
internet_path
=
IMAGES_URL
.
'/resource/lib/Attachments/images/'
;
...
@@ -747,8 +748,7 @@ class OfficeRoomService
...
@@ -747,8 +748,7 @@ class OfficeRoomService
//获取上传人信息
//获取上传人信息
public
function
getUploadInfo
(
$agent_id
){
public
function
getUploadInfo
(
$agent_id
){
$agent
=
[];
$agent
=
[];
$redis_service
=
new
RedisCacheService
();
$res
=
$this
->
redis_service
->
getRedisCache
(
2
,
$agent_id
);
$res
=
$redis_service
->
getRedisCache
(
2
,
$agent_id
);
if
(
$res
){
if
(
$res
){
$agent
[
'name'
]
=
$res
[
'name'
];
$agent
[
'name'
]
=
$res
[
'name'
];
$agent
[
'phone'
]
=
$res
[
'phone'
];
$agent
[
'phone'
]
=
$res
[
'phone'
];
...
@@ -1052,4 +1052,53 @@ class OfficeRoomService
...
@@ -1052,4 +1052,53 @@ class OfficeRoomService
return
$result
;
return
$result
;
}
}
/**
* 批量修改独家方
*
* @param $old_agents_id
* @param $agents_id
* @param $operation_id
* @return mixed
*/
public
function
batchChangDish
(
$old_agents_id
,
$agents_id
,
$operation_id
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'盘方信息错误'
;
if
(
empty
(
$old_agents_id
)
||
empty
(
$agents_id
))
{
return
$result
;
}
$where
[
'type'
]
=
2
;
$where
[
'b.id'
]
=
$old_agents_id
;
try
{
$agent_house
=
$this
->
agent_room
->
getAgentsByRoomId
(
'a.id,a.house_id'
,
$where
);
if
(
$agent_house
)
{
$agent_data_arr
=
[];
foreach
(
$agent_house
as
$k
=>
$v
)
{
$agent_data_arr
[
$k
][
'id'
]
=
$v
[
'id'
];
$agent_data_arr
[
$k
][
'agents_id'
]
=
$agents_id
;
}
}
if
(
isset
(
$agent_data_arr
))
{
$total
=
$this
->
agent_room
->
updateDataAll
(
$agent_data_arr
);
$m_operating
=
new
OfficeGOperatingRecord
();
foreach
(
$agent_house
as
$k
=>
$v
)
{
$agent_data
=
$this
->
redis_service
->
getRedisCache
(
2
,
$agents_id
);
$remark
=
'批量修改盘方方为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$m_operating
->
record
(
$operation_id
,
2
,
$remark
,
$v
[
'houses_id'
],
$v
[
'id'
]);
}
$result
[
'msg'
]
=
'修改'
.
$total
.
'条记录'
;
$result
[
'status'
]
=
'successful'
;
}
else
{
$result
[
'msg'
]
=
'无修改内容'
;
}
}
catch
(
\Exception
$e
)
{
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
}
}
\ No newline at end of file
application/route.php
View file @
19581628
...
@@ -1001,7 +1001,7 @@ Route::group('office_index', [
...
@@ -1001,7 +1001,7 @@ Route::group('office_index', [
'houseEdit'
=>
[
'index/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'houseEdit'
=>
[
'index/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'houseAdd'
=>
[
'index/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'houseAdd'
=>
[
'index/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'getRecords'
=>
[
'index/OfficeRoom/getRecords'
,
[
'method'
=>
'GET'
]],
//盘方操作记录
'getRecords'
=>
[
'index/OfficeRoom/getRecords'
,
[
'method'
=>
'GET'
]],
//盘方操作记录
'batchChangDish'
=>
[
'index/OfficeRoom/batchChangDish'
,
[
'method'
=>
'post'
]],
//批量修改盘方
]);
]);
Route
::
group
(
'office_api'
,
[
Route
::
group
(
'office_api'
,
[
...
...
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