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
e985cd85
Commit
e985cd85
authored
Jan 25, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加经纪人与楼盘关系
parent
c92e8a72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
GHousesToAgents.php
application/model/GHousesToAgents.php
+18
-19
No files found.
application/model/GHousesToAgents.php
View file @
e985cd85
...
@@ -24,27 +24,26 @@ class GHousesToAgents extends BaseModel
...
@@ -24,27 +24,26 @@ class GHousesToAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
addAgents
(
$
data
,
$houses_id
,
$type
){
public
function
addAgents
(
$
agents_id
,
$houses_id
,
$type
){
$agent_arr
=
array
();
$agent_arr
=
array
();
$data
=
array_unique
(
$data
);
foreach
(
$data
as
$k
=>
$v
)
{
$agents_id
=
array_unique
(
explode
(
','
,
$agents_id
));
$arr
=
explode
(
'-'
,
$v
);
if
(
count
(
$arr
)
==
3
)
{
foreach
(
$agents_id
as
$k
=>
$v
)
{
$check
=
$this
->
where
([
$check
=
$this
->
where
([
'houses_id'
=>
$houses_id
,
'houses_id'
=>
$houses_id
,
'agents_id'
=>
$arr
[
'0'
],
'agents_id'
=>
$v
,
'is_del'
=>
0
,
'is_del'
=>
0
,
'type'
=>
$type
'type'
=>
$type
])
->
find
();
])
->
find
();
if
(
$check
)
{
if
(
$check
)
{
continue
;
continue
;
}
$agent_arr
[
$k
][
'agents_id'
]
=
$arr
[
'0'
];
$agent_arr
[
$k
][
'houses_id'
]
=
$houses_id
;
$agent_arr
[
$k
][
'type'
]
=
$type
;
$agent_arr
[
$k
][
'create_time'
]
=
$this
->
date
;
$agent_arr
[
$k
][
'update_time'
]
=
$this
->
date
;
}
}
$agent_arr
[
$k
][
'agents_id'
]
=
$v
;
$agent_arr
[
$k
][
'houses_id'
]
=
$houses_id
;
$agent_arr
[
$k
][
'type'
]
=
$type
;
$agent_arr
[
$k
][
'create_time'
]
=
$this
->
date
;
$agent_arr
[
$k
][
'update_time'
]
=
$this
->
date
;
}
}
$res
=
$this
->
saveAll
(
$agent_arr
);
$res
=
$this
->
saveAll
(
$agent_arr
);
...
...
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