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
2f003dd3
Commit
2f003dd3
authored
Oct 25, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证autoken
parent
bba6303c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
0 deletions
+108
-0
Shop.php
application/api/controller/Shop.php
+72
-0
Basic.php
application/api_broker/extend/Basic.php
+2
-0
Regions.php
application/model/Regions.php
+33
-0
route.php
application/route.php
+1
-0
No files found.
application/api/controller/Shop.php
View file @
2f003dd3
...
@@ -336,6 +336,7 @@ class Shop extends Basic
...
@@ -336,6 +336,7 @@ class Shop extends Basic
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$city_code
=
isset
(
$params
[
"city_code"
])
?
$params
[
"city_code"
]
:
"330000"
;
//上海310000 浙江 330000
$city_code
=
isset
(
$params
[
"city_code"
])
?
$params
[
"city_code"
]
:
"330000"
;
//上海310000 浙江 330000
$regions
=
new
Regions
();
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsCitySH
(
$city_code
);
$cityList
=
$regions
->
getRegionsCitySH
(
$city_code
);
$i
=
$j
=
0
;
$i
=
$j
=
0
;
...
@@ -394,6 +395,77 @@ class Shop extends Basic
...
@@ -394,6 +395,77 @@ class Shop extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
/**
* 搜索页搜索条件
* @return \think\Response
*/
public
function
filtrateConditionV2
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
empty
(
$params
[
"city"
])){
return
$this
->
response
(
"101"
,
"参数错误"
);
}
$city
=
$params
[
"city"
];
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsByCity
(
$city
);
$i
=
$j
=
0
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
foreach
(
$cityList
as
$k
=>
$v
)
{
$i
++
;
if
(
!
empty
(
$v
[
"name"
]))
{
$result
[
"area"
][
$i
][
"city"
]
=
$v
[
"name"
];
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$v
[
"name"
];
}
foreach
(
$v
[
"city"
]
as
$item
)
{
if
(
!
empty
(
$item
))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
}
}
if
(
$j
==
0
)
{
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
'id'
=>
0
,
'name'
=>
'全部'
];
}
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
if
(
!
empty
(
$item2
))
{
$j
++
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
}
}
break
;
//目前只有上海和杭州其余的先不显示
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
//面积
$result
[
'acreage'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'30m²以内'
),
array
(
'id'
=>
'1'
,
'value'
=>
'30-60m²'
),
array
(
'id'
=>
'2'
,
'value'
=>
'60-100m²'
),
array
(
'id'
=>
'3'
,
'value'
=>
'100-300m²'
)
,
array
(
'id'
=>
'4'
,
'value'
=>
'300-500m²'
),
array
(
'id'
=>
'5'
,
'value'
=>
'500m²以上'
)
);
$result
[
'more'
][]
=
"全部"
;
$labelsResult
=
$this
->
labels
->
getLabels
();
if
(
count
(
$labelsResult
)
>
0
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
if
(
$labelsVal
[
'name'
])
{
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
}
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
/**
/**
* 商铺列表进场统计
* 商铺列表进场统计
* @return \think\Response
* @return \think\Response
...
...
application/api_broker/extend/Basic.php
View file @
2f003dd3
...
@@ -136,6 +136,8 @@ class Basic extends Controller
...
@@ -136,6 +136,8 @@ class Basic extends Controller
}
else
{
}
else
{
$this
->
city
=
$site_city
[
'city'
];
$this
->
city
=
$site_city
[
'city'
];
$this
->
siteId
=
$site_city
[
'site_id'
];
$this
->
siteId
=
$site_city
[
'site_id'
];
$redis_
->
set
(
"agent_city_"
.
$agentId
,
$this
->
city
);
$redis_
->
set
(
"agent_site_id_"
.
$agentId
,
$this
->
siteId
);
}
}
}
}
...
...
application/model/Regions.php
View file @
2f003dd3
...
@@ -119,6 +119,39 @@ class Regions extends Model
...
@@ -119,6 +119,39 @@ class Regions extends Model
return
$data
;
return
$data
;
}
}
/**
* @param $city
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRegionsByCity
(
$city
)
{
$data
=
[];
$city_data
=
$this
->
field
(
'code,fullName'
)
->
where
(
'fullName like %'
.
$city
.
'%'
)
->
select
();
$business
=
new
GBusinessDistrict
();
$all_arr
[
0
][
'id'
]
=
0
;
$all_arr
[
0
][
'name'
]
=
'全部'
;
foreach
(
$city_data
as
$k
=>
$v
)
{
$data
[
$k
][
'name'
]
=
$v
[
'fullName'
];
$data
[
$k
][
'city'
]
=
$this
->
where
(
'parentCode'
,
$v
[
'code'
])
->
column
(
'fullName'
);
//区和商圈
foreach
(
$data
[
$k
][
'city'
]
as
$k2
=>
$v2
)
{
$data
[
$k
][
'business_district'
][
$k2
][
'district'
]
=
$v2
;
$business_arr
=
$business
->
field
(
'id,name'
)
->
where
(
'city'
,
$v
[
'fullName'
])
->
where
(
'disc'
,
$v2
)
->
where
(
'is_del'
,
0
)
->
where
(
'status'
,
0
)
->
select
();
$data
[
$k
][
'business_district'
][
$k2
][
'business'
]
=
array_merge
(
$all_arr
,
$business_arr
);
}
}
return
$data
;
}
/**
/**
* 根据区code获取省市区中文
* 根据区code获取省市区中文
...
...
application/route.php
View file @
2f003dd3
...
@@ -379,6 +379,7 @@ Route::group('api', [
...
@@ -379,6 +379,7 @@ Route::group('api', [
// shop
// shop
'getShopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'get|post'
]
],
'getShopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'get|post'
]
],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'get | post'
]
],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'get | post'
]
],
'filtrateConditionV2'
=>
[
'api/shop/filtrateConditionV2'
,
[
'method'
=>
'get | post'
]
],
'getShopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get|post'
]
],
'getShopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get|post'
]
],
'getMarchInList'
=>
[
'api/shop/getMarchInList'
,
[
'method'
=>
'get|post'
]
],
'getMarchInList'
=>
[
'api/shop/getMarchInList'
,
[
'method'
=>
'get|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