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
fdf9309a
Commit
fdf9309a
authored
Jan 03, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人与楼盘关系优化
parent
ece4eafb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
4 deletions
+54
-4
Houses.php
application/index/controller/Houses.php
+1
-1
HouseService.php
application/index/service/HouseService.php
+1
-1
GHouses.php
application/model/GHouses.php
+4
-2
GHousesToAgents.php
application/model/GHousesToAgents.php
+48
-0
No files found.
application/index/controller/Houses.php
View file @
fdf9309a
...
@@ -535,7 +535,7 @@ class Houses extends Basic
...
@@ -535,7 +535,7 @@ class Houses extends Basic
*/
*/
public
function
editExclusive
()
public
function
editExclusive
()
{
{
if
(
empty
(
$this
->
params
[
'house_id'
])
||
empty
(
$this
->
params
[
'exclusive_id'
]))
{
if
(
empty
(
$this
->
params
[
'house
s
_id'
])
||
empty
(
$this
->
params
[
'exclusive_id'
]))
{
return
$this
->
response
(
101
,
'参数错误'
);
return
$this
->
response
(
101
,
'参数错误'
);
}
}
...
...
application/index/service/HouseService.php
View file @
fdf9309a
...
@@ -436,7 +436,6 @@ class HouseService
...
@@ -436,7 +436,6 @@ class HouseService
try
{
try
{
$records
=
new
GOperatingRecords
();
$records
=
new
GOperatingRecords
();
$sum
=
new
ResultsSummaryNewTask
();
$count
=
0
;
$count
=
0
;
$save_data
=
$del_agent_name
=
$del_agent_id
=
[];
$save_data
=
$del_agent_name
=
$del_agent_id
=
[];
$agent_id_arr
=
array_unique
(
explode
(
','
,
$agent_id_string
));
$agent_id_arr
=
array_unique
(
explode
(
','
,
$agent_id_string
));
...
@@ -471,6 +470,7 @@ class HouseService
...
@@ -471,6 +470,7 @@ class HouseService
$this
->
agent_house
->
updateUserAll
(
$save_data
);
$this
->
agent_house
->
updateUserAll
(
$save_data
);
if
(
$type
==
2
)
{
if
(
$type
==
2
)
{
$sum
=
new
ResultsSummaryNewTask
();
//记录
//记录
$remark
=
''
;
$remark
=
''
;
if
(
$del_agent_name
)
{
if
(
$del_agent_name
)
{
...
...
application/model/GHouses.php
View file @
fdf9309a
...
@@ -821,10 +821,12 @@ class GHouses extends BaseModel
...
@@ -821,10 +821,12 @@ class GHouses extends BaseModel
$ext_result
=
$ext
->
save
(
$update_data
,
[
'house_id'
=>
$data
[
'houses_id'
]
]);
$ext_result
=
$ext
->
save
(
$update_data
,
[
'house_id'
=>
$data
[
'houses_id'
]
]);
$house_img
=
new
GHousesImgs
();
$house_img
=
new
GHousesImgs
();
$house_img
->
editExclusiveImg
(
$data
,
$house_id
);
// $house_img->editExclusiveImg($data, $house_id);
$house_img
->
editV2
(
$data
[
'exclusive_img'
],
$house_id
,
4
);
$agents
=
new
GHousesToAgents
();
$agents
=
new
GHousesToAgents
();
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
,
$operation_id
,
$site_id
);
// $agents->addAgents($data['exclusive_id'], $house_id, 3, $operation_id, $site_id);
$agents
->
addAgentV2
(
$data
[
'exclusive_id'
],
$house_id
,
3
);
$m_house_file
=
new
GHouseFile
();
$m_house_file
=
new
GHouseFile
();
...
...
application/model/GHousesToAgents.php
View file @
fdf9309a
...
@@ -137,6 +137,54 @@ class GHousesToAgents extends BaseModel
...
@@ -137,6 +137,54 @@ class GHousesToAgents extends BaseModel
return
$res
;
return
$res
;
}
}
/**
* 处理经纪人与楼盘关系
* $type 类型:"场权限人:1,盘方:2,独家:3
*
* @param $agent_id_string
* @param $house_id
* @param $type
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
addAgentV2
(
$agent_id_string
,
$house_id
,
$type
)
{
if
(
empty
(
$agent_id_string
))
{
return
false
;
}
$agent_id_arr
=
array_unique
(
explode
(
','
,
$agent_id_string
));
$save_data
=
[];
$agent_house_where
[
'a.is_del'
]
=
0
;
$agent_house_where
[
'a.houses_id'
]
=
$house_id
;
$agent_house_where
[
'a.type'
]
=
$type
;
$agent_data_old
=
$this
->
getAgentsByHouseId
(
'a.id,a.agents_id,a.houses_id,b.name'
,
$agent_house_where
);
$count
=
0
;
foreach
(
$agent_data_old
as
$v
)
{
if
(
in_array
(
$v
[
'agents_id'
],
$agent_id_arr
))
{
$key
=
array_search
(
$v
[
'agents_id'
],
$agent_id_arr
);
if
(
$key
!==
false
)
{
unset
(
$agent_id_arr
[
$key
]);
}
}
else
{
$save_data
[
$count
][
'id'
]
=
$v
[
'id'
];
$save_data
[
$count
][
'is_del'
]
=
1
;
$count
++
;
}
}
foreach
(
$agent_id_arr
as
$val
)
{
$save_data
[
$count
][
'agents_id'
]
=
$val
;
$save_data
[
$count
][
'houses_id'
]
=
$house_id
;
$save_data
[
$count
][
'type'
]
=
$type
;
$count
++
;
}
$this
->
saveAll
(
$save_data
);
}
/**
/**
* 新增经纪人和楼盘关系
* 新增经纪人和楼盘关系
*
*
...
...
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