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
ee3e0f30
Commit
ee3e0f30
authored
Feb 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑商铺,获取信息修改
parent
45e16670
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
GHouses.php
application/model/GHouses.php
+34
-2
GHousesToAgents.php
application/model/GHousesToAgents.php
+33
-0
No files found.
application/model/GHouses.php
View file @
ee3e0f30
...
...
@@ -25,6 +25,35 @@ class GHouses extends BaseModel
->
where
(
'a.id'
,
$id
)
->
find
();
$data
=
$select_data
->
getData
();
/*案场,盘方,独家 start*/
$houseAgents
=
new
GHousesToAgents
();
$agents_data
=
$houseAgents
->
getHousesAgents
(
$id
);
$agents_str
=
''
;
$exclusive_str
=
''
;
$dish_str
=
''
;
foreach
(
$agents_data
as
$k
=>
$v
)
{
if
(
$v
[
'type'
]
==
1
)
{
$agents_str
.=
$v
[
'id'
]
.
','
;
$data
[
'agents_name'
][
$k
]
=
$v
[
'id'
]
.
'-'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
];
}
elseif
(
$v
[
'type'
]
==
2
)
{
$dish_str
.=
$v
[
'id'
]
.
','
;
$data
[
'dish_name'
][
$k
]
=
$v
[
'id'
]
.
'-'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
];
}
elseif
(
$v
[
'type'
]
==
3
)
{
$exclusive_str
.=
$v
[
'id'
]
.
','
;
$data
[
'exclusive_name'
][
$k
]
=
$v
[
'id'
]
.
'-'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
];
}
}
$data
[
'agent_data'
]
=
rtrim
(
$agents_str
,
','
);
$data
[
'agent_dish'
]
=
rtrim
(
$dish_str
,
','
);
$data
[
'exclusive_ids'
]
=
rtrim
(
$exclusive_str
,
','
);
/*案场,盘方,独家 end*/
/*案场联系人 start*/
$case
=
new
ACase
();
$data
[
'phone'
]
=
$case
->
where
(
'id'
,
'in'
,
$data
[
'case_id'
])
->
where
(
'status'
,
0
)
->
column
(
'name,phone'
);
/*案场联系人 end*/
/*图片 start*/
$img
=
new
GHousesImgs
();
$img_data
=
$img
->
field
(
'id,img_type,img_name'
)
->
where
(
'img_status = 0 AND house_id = '
.
$id
)
...
...
@@ -37,12 +66,15 @@ class GHouses extends BaseModel
switch
(
$v
->
img_type
)
{
case
1
:
$data
[
'cover'
]
=
$v
;
break
;
case
2
:
case
2
:
$data
[
'slide_show'
][
$k
]
=
$v
;
break
;
case
3
:
$data
[
'plan'
][
$k
]
=
$v
;
break
;
default
:
$data
[
'
plan
'
][
$k
]
=
$v
;
$data
[
'
exclusive_img
'
][
$k
]
=
$v
;
}
}
/*图片 start*/
return
$data
;
}
...
...
application/model/GHousesToAgents.php
View file @
ee3e0f30
...
...
@@ -124,6 +124,19 @@ class GHousesToAgents extends BaseModel
return
$res
;
}
/**
* 经纪人与楼盘信息列表分页
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsHousesList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
...
...
@@ -134,4 +147,24 @@ class GHousesToAgents extends BaseModel
->
page
(
$pageNo
)
->
select
();
}
/**
* 楼盘对应的经纪人信息
*
* @param $houses_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHousesAgents
(
$houses_id
)
{
$select_data
=
$this
->
field
(
'b.id,name,a.type,b.phone'
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'LEFT'
)
->
where
([
'houses_id'
=>
$houses_id
,
'is_del'
=>
0
])
->
select
();
return
$select_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