Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
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
newshop
newShopBack
Commits
15abc841
Commit
15abc841
authored
Dec 17, 2019
by
侯贺政
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取所有省市
Signed-off-by:
houhezheng
<
houhezheng@romens.cn
>
parent
84e88f51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
urlmanager.php
backend/config/urlmanager.php
+17
-0
ShopTransportAreaController.php
...end/controllers/v1/common/ShopTransportAreaController.php
+33
-0
No files found.
backend/config/urlmanager.php
View file @
15abc841
...
@@ -214,6 +214,7 @@ return [
...
@@ -214,6 +214,7 @@ return [
],
],
'extraPatterns'
=>
[
'extraPatterns'
=>
[
'GET,OPTIONS area'
=>
'area'
,
'GET,OPTIONS area'
=>
'area'
,
'GET,OPTIONS provinces-city'
=>
'provinces-city'
,
],
],
],
],
//模板下载类
//模板下载类
...
@@ -334,6 +335,22 @@ return [
...
@@ -334,6 +335,22 @@ return [
'POST,OPTIONS shop-goods-import'
=>
'shop-goods-import'
,
'POST,OPTIONS shop-goods-import'
=>
'shop-goods-import'
,
]
]
],
],
//商品详情页模板
[
'class'
=>
'yii\rest\UrlRule'
,
'controller'
=>
[
'v1/shopgoods/goods-detail-setting'
,
],
'extraPatterns'
=>
[
'GET,OPTIONS setting-list'
=>
'setting-list'
,
'GET,OPTIONS setting-detals'
=>
'setting-detals'
,
'POST,OPTIONS setting-add'
=>
'setting-add'
,
'PUT,OPTIONS setting-update'
=>
'setting-update'
,
'DELETE,OPTIONS setting-del'
=>
'setting-del'
,
'POST,OPTIONS associated-goods-import'
=>
'associated-goods-import'
,
'POST,OPTIONS associated-goods'
=>
'associated-goods'
,
]
],
],
],
],
],
]
]
...
...
backend/controllers/v1/common/ShopTransportAreaController.php
View file @
15abc841
...
@@ -45,4 +45,37 @@ class ShopTransportAreaController extends BaseController
...
@@ -45,4 +45,37 @@ class ShopTransportAreaController extends BaseController
)
)
);
);
}
}
/**
* @OA\GET(
* path="/backend/web/v1/common/shop-transport-areas/provinces-city",
* tags={"公用类接口"},
* summary="获取所有省市(侯贺政)",
* description="获取所有省市,省份下包含城市",
* @OA\Response(response="200",description="
* GUID:省市GUID,
* NAME:省市名称,
* PARENT_GUID:上级区域GUID"),
* security={{"Authorization": {}}}
* )
*/
public
function
actionProvincesCity
()
{
$model
=
new
$this
->
modelClass
();
$areaArr
=
$model
::
find
()
->
select
(
'GUID,NAME,PARENT_GUID'
)
->
where
([
'or'
,[
'like'
,
'PARENT_GUID'
,
'P'
],[
'PARENT_GUID'
=>
''
]])
->
andWhere
([
'!='
,
'GUID'
,
'P0'
])
->
orderBy
(
'PARENT_GUID ASC'
)
->
asArray
()
->
all
();
foreach
(
$areaArr
as
$key
=>
$value
)
{
if
(
empty
(
trim
(
$value
[
'PARENT_GUID'
])))
{
$areaInfo
[
$value
[
'GUID'
]]
=
$value
;
continue
;
}
$areaInfo
[
$value
[
'PARENT_GUID'
]][
'CITY'
][]
=
$value
;
}
return
$areaInfo
;
}
}
}
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