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
efab9ff8
Commit
efab9ff8
authored
Jan 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺列表搜索
parent
6d140818
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
42 deletions
+29
-42
Houses.php
application/index/controller/Houses.php
+3
-0
GHouses.php
application/model/GHouses.php
+26
-42
No files found.
application/index/controller/Houses.php
View file @
efab9ff8
...
@@ -199,6 +199,7 @@ class Houses extends Basic
...
@@ -199,6 +199,7 @@ class Houses extends Basic
$where
[
'industry_type'
]
=
[
'LIKE'
,
$params
[
'industry_type'
]
.
'%'
];
$where
[
'industry_type'
]
=
[
'LIKE'
,
$params
[
'industry_type'
]
.
'%'
];
}
}
//案场权限人搜索
if
(
empty
(
$params
[
'dish'
]))
{
if
(
empty
(
$params
[
'dish'
]))
{
/*楼盘编号*/
/*楼盘编号*/
if
(
$params
[
'id'
]
!=
NULL
)
{
if
(
$params
[
'id'
]
!=
NULL
)
{
...
@@ -208,12 +209,14 @@ class Houses extends Basic
...
@@ -208,12 +209,14 @@ class Houses extends Basic
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getTotal
(
$where
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getTotal
(
$where
);
}
else
{
}
else
{
//盘方人搜索
/*楼盘编号*/
/*楼盘编号*/
if
(
$params
[
'id'
]
!=
NULL
)
{
if
(
$params
[
'id'
]
!=
NULL
)
{
$where
[
'a.id'
]
=
$params
[
'id'
];
$where
[
'a.id'
]
=
$params
[
'id'
];
}
}
$where
[
'a.status'
]
=
[
'<>'
,
2
];
$where
[
'a.status'
]
=
[
'<>'
,
2
];
$where
[
'c.name'
]
=
[
'LIKE'
,
$params
[
'dish'
]
.
'%'
];
$where
[
'c.name'
]
=
[
'LIKE'
,
$params
[
'dish'
]
.
'%'
];
$where
[
'b.type'
]
=
[
'='
,
1
];
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseListDish
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseListDish
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getHouseListDishTotal
(
$where
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getHouseListDishTotal
(
$where
);
}
}
...
...
application/model/GHouses.php
View file @
efab9ff8
...
@@ -73,16 +73,9 @@ class GHouses extends BaseModel
...
@@ -73,16 +73,9 @@ class GHouses extends BaseModel
if
(
empty
(
$house_id
))
{
if
(
empty
(
$house_id
))
{
$result
=
$data
;
$result
=
$data
;
}
else
{
}
else
{
/*案场权限人*/
/*案场权限人
和盘方
*/
$house_agents
=
Db
::
table
(
'g_houses_to_agents'
)
->
alias
(
'a'
)
$house_agents
=
Db
::
table
(
'g_houses_to_agents'
)
->
alias
(
'a'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone,a.type'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
select
();
/*盘方*/
$house_dish
=
Db
::
table
(
'g_houses_dish'
)
->
alias
(
'a'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
select
();
->
select
();
...
@@ -91,17 +84,16 @@ class GHouses extends BaseModel
...
@@ -91,17 +84,16 @@ class GHouses extends BaseModel
$result
[
$k
]
=
$v
->
toArray
();
$result
[
$k
]
=
$v
->
toArray
();
foreach
(
$house_agents
as
$k2
=>
$v2
)
{
foreach
(
$house_agents
as
$k2
=>
$v2
)
{
if
(
$v
->
id
==
$v2
[
'houses_id'
])
{
if
(
$v
->
id
==
$v2
[
'houses_id'
])
{
$result
[
$k
][
'agents_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
if
(
$v2
[
'type'
]
==
0
)
{
$result
[
$k
][
'agents_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
}
$result
[
$k
][
'agents_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
}
}
if
(
$v2
[
'type'
]
==
1
)
{
foreach
(
$house_dish
as
$k3
=>
$v3
)
{
$result
[
$k
][
'dish_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
if
(
$v
->
id
==
$v3
[
'houses_id'
])
{
$result
[
$k
][
'dish_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
$result
[
$k
][
'dish_name'
][
$k3
][
'id'
]
=
$v3
[
'id'
];
$result
[
$k
][
'dish_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
$result
[
$k
][
'dish_name'
][
$k3
][
'name'
]
=
$v3
[
'name'
];
}
$result
[
$k
][
'dish_name'
][
$k3
][
'phone'
]
=
$v3
[
'phone'
];
}
}
}
}
}
}
...
@@ -125,7 +117,7 @@ class GHouses extends BaseModel
...
@@ -125,7 +117,7 @@ class GHouses extends BaseModel
*/
*/
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'g_houses_
dish
b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'g_houses_
to_agents
b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -141,16 +133,9 @@ class GHouses extends BaseModel
...
@@ -141,16 +133,9 @@ class GHouses extends BaseModel
if
(
empty
(
$house_id
))
{
if
(
empty
(
$house_id
))
{
$result
=
$data
;
$result
=
$data
;
}
else
{
}
else
{
/*案场权限人*/
/*案场权限人
和盘方
*/
$house_agents
=
Db
::
table
(
'g_houses_to_agents'
)
->
alias
(
'a'
)
$house_agents
=
Db
::
table
(
'g_houses_to_agents'
)
->
alias
(
'a'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone,a.type'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
select
();
/*盘方*/
$house_dish
=
Db
::
table
(
'g_houses_dish'
)
->
alias
(
'a'
)
->
field
(
'a.houses_id,b.id,b.name,b.phone'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
select
();
->
select
();
...
@@ -159,17 +144,16 @@ class GHouses extends BaseModel
...
@@ -159,17 +144,16 @@ class GHouses extends BaseModel
$result
[
$k
]
=
$v
->
toArray
();
$result
[
$k
]
=
$v
->
toArray
();
foreach
(
$house_agents
as
$k2
=>
$v2
)
{
foreach
(
$house_agents
as
$k2
=>
$v2
)
{
if
(
$v
->
id
==
$v2
[
'houses_id'
])
{
if
(
$v
->
id
==
$v2
[
'houses_id'
])
{
$result
[
$k
][
'agents_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
if
(
$v2
[
'type'
]
==
0
)
{
$result
[
$k
][
'agents_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
$result
[
$k
][
'agents_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
}
$result
[
$k
][
'agents_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
}
}
if
(
$v2
[
'type'
]
==
1
)
{
foreach
(
$house_dish
as
$k3
=>
$v3
)
{
$result
[
$k
][
'dish_name'
][
$k2
][
'id'
]
=
$v2
[
'id'
];
if
(
$v
->
id
==
$v3
[
'houses_id'
])
{
$result
[
$k
][
'dish_name'
][
$k2
][
'name'
]
=
$v2
[
'name'
];
$result
[
$k
][
'dish_name'
][
$k3
][
'id'
]
=
$v3
[
'id'
];
$result
[
$k
][
'dish_name'
][
$k2
][
'phone'
]
=
$v2
[
'phone'
];
$result
[
$k
][
'dish_name'
][
$k3
][
'name'
]
=
$v3
[
'name'
];
}
$result
[
$k
][
'dish_name'
][
$k3
][
'phone'
]
=
$v3
[
'phone'
];
}
}
}
}
}
}
...
@@ -185,7 +169,7 @@ class GHouses extends BaseModel
...
@@ -185,7 +169,7 @@ class GHouses extends BaseModel
*/
*/
public
function
getHouseListDishTotal
(
$params
=
''
)
{
public
function
getHouseListDishTotal
(
$params
=
''
)
{
$data
=
$this
->
alias
(
'a'
)
$data
=
$this
->
alias
(
'a'
)
->
join
(
'g_houses_
dish
b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'g_houses_
to_agents
b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
count
();
->
count
();
...
...
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