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
aa7c672d
Commit
aa7c672d
authored
Oct 17, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图找房
parent
a0650666
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
MapFindHouse.php
application/api_broker/controller/MapFindHouse.php
+16
-5
GHouses.php
application/model/GHouses.php
+16
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/MapFindHouse.php
View file @
aa7c672d
...
...
@@ -3,6 +3,7 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\GHouses
;
use
think\Request
;
/**
...
...
@@ -14,20 +15,28 @@ use think\Request;
*/
class
MapFindHouse
extends
Basic
{
private
$gHousesModel
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
gHousesModel
=
new
GHouses
();
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getShopListByMap
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"first_spot" => "1223,1213123",
"second_spot" => "1223,1213123",
"grade" => 1,//1 市,2区,3街道
"source" => 1,//来源 1b端,2c端
);
);
*/
$checkResult
=
$this
->
validate
(
$params
,
"MapFindHouseValidate.getShopListByMap"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
...
...
@@ -40,16 +49,18 @@ class MapFindHouse extends Basic
$conditions
=
[];
$conditions
[
"longitude"
]
=
array
(
"between"
,
array
(
$first_spot_arr
[
0
],
$second_spot_arr
[
0
]));
$conditions
[
"latitude"
]
=
array
(
"between"
,
array
(
$first_spot_arr
[
1
],
$second_spot_arr
[
1
]));
switch
(
$params
[
"grade"
]){
/*
switch ($params["grade"]){
case 1:
break;
case 2:
break;
case 3:
break;
default:
}
}*/
$field
=
"id,internal_title,longitude,latitude"
;
$result
=
$this
->
gHousesModel
->
getHousesListByMap
(
$field
,
$conditions
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
...
...
application/model/GHouses.php
View file @
aa7c672d
...
...
@@ -949,6 +949,22 @@ class GHouses extends BaseModel
->
select
();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
function
getHousesListByMap
(
$field
,
$params
)
{
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
}
/**
* @param $params
* @param $spTagsArr
...
...
application/route.php
View file @
aa7c672d
...
...
@@ -516,6 +516,7 @@ Route::group('broker', [
'inviteList'
=>
[
'api_broker/Client/inviteList'
,
[
'method'
=>
'get'
]
],
//邀请记录
//商铺
'getShopList'
=>
[
'api_broker/Shop/getShopList'
,
[
'method'
=>
'get|post'
]
],
'getShopListByMap'
=>
[
'api_broker/MapFindHouse/getShopListByMap'
,
[
'method'
=>
'get|post'
]
],
'getShopDetail'
=>
[
'api_broker/Shop/getShopDetail'
,
[
'method'
=>
'get'
]
],
'addShopFollowUp'
=>
[
'api_broker/Shop/addShopFollowUp'
,
[
'method'
=>
'post'
]
],
//新增商铺跟进记录
...
...
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