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
ed868571
Commit
ed868571
authored
Oct 17, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图找房
parent
88af4fe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
MapFindHouse.php
application/api_broker/controller/MapFindHouse.php
+58
-0
MapFindHouseValidate.php
application/api_broker/validate/MapFindHouseValidate.php
+38
-0
No files found.
application/api_broker/controller/MapFindHouse.php
0 → 100644
View file @
ed868571
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/10/17
* Time : 上午9:40
* Intro: 地图找房
*/
class
MapFindHouse
extends
Basic
{
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
}
public
function
getShopListByMap
()
{
$params
=
$this
->
params
;
$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
);
}
$first_spot_arr
=
explode
(
$params
[
"first_spot"
],
","
);
$second_spot_arr
=
explode
(
$params
[
"second_spot"
],
","
);
if
(
count
(
$first_spot_arr
)
<
2
||
count
(
$second_spot_arr
)
<
2
)
{
return
$this
->
response
(
"101"
,
"坐标传入有误"
);
}
$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"
]){
case
1
:
break
;
case
2
:
break
;
case
3
:
break
;
default
:
}
}
}
\ No newline at end of file
application/api_broker/validate/MapFindHouseValidate.php
0 → 100644
View file @
ed868571
<?php
namespace
app\api_broker\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/10/17
* Time : 上午10:19
* Intro:
*/
class
MapFindHouseValidate
extends
Validate
{
protected
$rule
=
[
'first_spot'
=>
'require'
,
'second_spot'
=>
'require'
,
'grade'
=>
'require|number|in:1,2,3'
,
'source'
=>
'require|number|in:1,2'
,
];
protected
$message
=
[
'first_spot.require'
=>
'坐标为必传字段'
,
'second_spot.require'
=>
'坐标为必传字段'
,
'grade.require'
=>
'级别为必传'
,
'grade.number'
=>
'级别为必传'
,
'grade.in'
=>
'级别参数错误'
,
'source.require'
=>
'来源为必传'
,
'source.number'
=>
'来源为必传'
,
'source.in'
=>
'来源参数错误'
,
];
protected
$scene
=
[
'getShopListByMap'
=>
[
'first_spot'
,
'second_spot'
,
'grade'
,
'source'
],
];
}
\ No newline at end of file
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