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
462401b0
Commit
462401b0
authored
Aug 14, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺列表优化
parent
9aa586a6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
18 deletions
+52
-18
Houses.php
application/index/controller/Houses.php
+0
-0
GHouses.php
application/model/GHouses.php
+34
-15
GHousesToAgents.php
application/model/GHousesToAgents.php
+18
-3
No files found.
application/index/controller/Houses.php
View file @
462401b0
This diff is collapsed.
Click to expand it.
application/model/GHouses.php
View file @
462401b0
...
...
@@ -272,19 +272,28 @@ class GHouses extends BaseModel
*/
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
,
$agents_id
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'g_houses_to_agents b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'g_houses_ext d'
,
'a.id=d.house_id'
,
'left'
)
// $data = $this->field($field)->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->order($order_)
// ->limit($pageSize)
// ->page($pageNo)
// ->group('a.id')
// ->select();
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
group
(
'a.id'
)
->
select
();
$house_id
=
array
();
$house_id
=
[];
$house_follow_up
=
new
GHousesFollowUp
();
foreach
(
$data
as
$k
=>
$v
)
{
$house_id
[
$k
]
=
$v
[
'id'
];
$v
->
create_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
->
create_time
));
...
...
@@ -340,14 +349,15 @@ class GHouses extends BaseModel
*/
public
function
getHouseListDishTotal
(
$params
=
''
)
{
$data
=
$this
->
alias
(
'a'
)
->
join
(
'g_houses_to_agents b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'g_houses_ext d'
,
'a.id=d.house_id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
return
$data
;
// $data = $this->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// return $data;
return
$this
->
where
(
$params
)
->
count
();
}
/**
...
...
@@ -764,6 +774,9 @@ class GHouses extends BaseModel
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
'landlord_phone'
]))
{
$where_
[
"landlord_phone"
]
=
$params
[
'landlord_phone'
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
...
...
@@ -772,11 +785,17 @@ class GHouses extends BaseModel
return
$result
;
}
/**
* 获取新增楼盘数据
*
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddHouseList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
...
...
application/model/GHousesToAgents.php
View file @
462401b0
...
...
@@ -200,6 +200,20 @@ class GHousesToAgents extends BaseModel
return
$result
;
}
/**
* @param $field
* @param $params
* @return array
*/
public
function
getAgentsHouseField
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agents_id = b.id"
,
"left"
)
->
where
(
$params
)
->
column
(
$field
);
}
/**
* 楼盘对应的经纪人信息
*
...
...
@@ -250,14 +264,15 @@ class GHousesToAgents extends BaseModel
*
* @param $house_id
* @param int $type
* @return array|\PDOStatement|string|\think\Model
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentList
(
$house_id
,
$type
=
1
)
public
function
getAgentList
(
$house_id
,
$type
=
1
,
$field
=
'b.id,device_id,b.name,b.phone'
)
{
return
$this
->
field
(
'b.id,device_id,b.name,b.phone'
)
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'left'
)
->
where
(
'houses_id'
,
$house_id
)
...
...
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