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
60fc7091
Commit
60fc7091
authored
Jan 29, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独家方
parent
3a53dd99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
Houses.php
application/index/controller/Houses.php
+20
-0
GHouses.php
application/model/GHouses.php
+34
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Houses.php
View file @
60fc7091
...
...
@@ -250,4 +250,23 @@ class Houses extends Basic
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 获取独家方
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$this
->
data
=
$this
->
house
->
getExclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
60fc7091
...
...
@@ -291,4 +291,38 @@ class GHouses extends BaseModel
}
return
$return
;
}
/**
* 获取独家方信息
*
* @param $data
* @param $houses_id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getExclusive
(
$data
,
$houses_id
)
{
$result
=
$this
->
field
(
'id'
)
->
where
(
'id'
,
$houses_id
)
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
if
(
$result
->
id
)
{
$house_ext
=
$this
->
table
(
'g_houses_ext'
)
->
where
(
'house_id'
,
$houses_id
)
->
field
(
'agent_start_time,agent_end_time'
)
->
find
();
$agents
=
$this
->
table
(
'g_houses_to_agents'
)
->
field
(
'b.id,b.name,b.phone'
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.is_del'
,
'<>'
,
1
)
->
where
(
'b.status'
,
0
)
->
find
();
$img
=
$this
->
table
(
'g_houses_imgs'
)
->
field
(
'img_name'
)
->
where
(
'house_id'
,
$houses_id
)
->
where
(
'img_status'
,
0
)
->
select
();
$return
[
'id'
]
=
$agents
->
id
;
$return
[
'name'
]
=
$agents
[
'name'
]
.
'-'
.
$agents
[
'phone'
];
$return
[
'agent_start_time'
]
=
$house_ext
[
'agent_start_time'
];
$return
[
'agent_end_time'
]
=
$house_ext
[
'agent_end_time'
];
$return
[
'exclusive_img'
]
=
$img
;
}
else
{
$return
=
false
;
}
return
$return
;
}
}
application/route.php
View file @
60fc7091
...
...
@@ -107,6 +107,7 @@ Route::group('index', [
'getHouseList'
=>
[
'index/houses/getHouseList'
,
[
'method'
=>
'get'
]],
//楼盘列表
'carefullyChosen'
=>
[
'index/houses/carefullyChosen'
,
[
'method'
=>
'post'
]],
//设置精选楼盘
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]],
//添加和编辑楼盘独家
'getExclusive'
=>
[
'index/houses/getExclusive'
,
[
'method'
=>
'get'
]],
//获取楼盘独家
]);
...
...
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