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
1dd9be5f
Commit
1dd9be5f
authored
Dec 05, 2019
by
侯贺政
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取指定省级 和 运费模板删除
Signed-off-by:
houhezheng
<
houhezheng@romens.cn
>
parent
0f466f9b
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
191 additions
and
48 deletions
+191
-48
urlmanager.php
backend/config/urlmanager.php
+4
-1
BranchScoreController.php
backend/controllers/v1/branch/BranchScoreController.php
+3
-2
TransportSettingController.php
...d/controllers/v1/transport/TransportSettingController.php
+83
-1
ShopBranch.php
backend/models/v1/branch/ShopBranch.php
+99
-42
ShopPackagingcostsBranches.php
backend/models/v1/transport/ShopPackagingcostsBranches.php
+2
-2
No files found.
backend/config/urlmanager.php
View file @
1dd9be5f
...
@@ -220,7 +220,7 @@ return [
...
@@ -220,7 +220,7 @@ return [
'GET,OPTIONS template-file'
=>
'template-file'
,
'GET,OPTIONS template-file'
=>
'template-file'
,
],
],
],
],
//
运费模板
//
快递配送价格
[
[
'class'
=>
'yii\rest\UrlRule'
,
'class'
=>
'yii\rest\UrlRule'
,
'controller'
=>
[
'controller'
=>
[
...
@@ -229,7 +229,10 @@ return [
...
@@ -229,7 +229,10 @@ return [
'extraPatterns'
=>
[
'extraPatterns'
=>
[
'GET,OPTIONS transport-templates'
=>
'transport-templates'
,
'GET,OPTIONS transport-templates'
=>
'transport-templates'
,
'GET,OPTIONS transport-fee-details'
=>
'transport-fee-details'
,
'GET,OPTIONS transport-fee-details'
=>
'transport-fee-details'
,
'GET,OPTIONS get-branches-packaging'
=>
'get-branches-packaging'
,
'PUT,OPTIONS transport-fee-update'
=>
'transport-fee-update'
,
'PUT,OPTIONS transport-fee-update'
=>
'transport-fee-update'
,
'DELETE,OPTIONS transport-fee-del'
=>
'transport-fee-del'
,
'POST,OPTIONS transport-fee-add'
=>
'transport-fee-add'
,
],
],
],
],
//o2o起送价设置
//o2o起送价设置
...
...
backend/controllers/v1/branch/BranchScoreController.php
View file @
1dd9be5f
...
@@ -189,7 +189,7 @@ class BranchScoreController extends BaseController
...
@@ -189,7 +189,7 @@ class BranchScoreController extends BaseController
* @OA\Parameter(
* @OA\Parameter(
* description="要删除的门店服务评价GUID",
* description="要删除的门店服务评价GUID",
* in="query",
* in="query",
* name="
guid
",
* name="
GUID
",
* required=true,
* required=true,
* @OA\Schema(
* @OA\Schema(
* type="string",
* type="string",
...
@@ -202,8 +202,9 @@ class BranchScoreController extends BaseController
...
@@ -202,8 +202,9 @@ class BranchScoreController extends BaseController
* security={{"Authorization":{}}},
* security={{"Authorization":{}}},
* )
* )
*/
*/
public
function
actionScoreInfoDel
(
$guid
)
public
function
actionScoreInfoDel
()
{
{
$guid
=
Yii
::
$app
->
request
->
get
(
'GUID'
);
$model
=
ShopBranchScore
::
findOne
(
$guid
);
$model
=
ShopBranchScore
::
findOne
(
$guid
);
if
(
!
$model
)
{
if
(
!
$model
)
{
throw
new
BadRequestHttpException
(
"Requested resource does not exist !"
);
throw
new
BadRequestHttpException
(
"Requested resource does not exist !"
);
...
...
backend/controllers/v1/transport/TransportSettingController.php
View file @
1dd9be5f
...
@@ -138,7 +138,7 @@ class TransportSettingController extends BaseController
...
@@ -138,7 +138,7 @@ class TransportSettingController extends BaseController
* path="/backend/web/v1/transport/transport-settings/transport-fee-update",
* path="/backend/web/v1/transport/transport-settings/transport-fee-update",
* tags={"配送管理"},
* tags={"配送管理"},
* summary="更新运费模板信息详情(侯贺政)",
* summary="更新运费模板信息详情(侯贺政)",
* description="更新
(
运费模板信息详情",
* description="更新运费模板信息详情",
* @OA\RequestBody(
* @OA\RequestBody(
* required=true,
* required=true,
* description="注:模板GUID、配送方式、是否启用必填,其他根据需要选填;限制人群、配送城市、指定省级多项使用英文逗号隔开。",
* description="注:模板GUID、配送方式、是否启用必填,其他根据需要选填;限制人群、配送城市、指定省级多项使用英文逗号隔开。",
...
@@ -167,6 +167,10 @@ class TransportSettingController extends BaseController
...
@@ -167,6 +167,10 @@ class TransportSettingController extends BaseController
* response=200,
* response=200,
* description="更新成功!"
* description="更新成功!"
* ),
* ),
* @OA\Response(
* response=422,
* description="数据验证错误,错误信息(数组)。",
* ),
* security={{"Authorization":{}}},
* security={{"Authorization":{}}},
* )
* )
*/
*/
...
@@ -249,4 +253,82 @@ class TransportSettingController extends BaseController
...
@@ -249,4 +253,82 @@ class TransportSettingController extends BaseController
}
}
throw
new
HttpException
(
200
,
"更新成功!"
);
throw
new
HttpException
(
200
,
"更新成功!"
);
}
}
/**
* @OA\GET(
* path="/backend/web/v1/transport/transport-settings/get-branches-packaging",
* tags={"配送管理"},
* summary="获取指定省级列表(侯贺政)",
* description="添加指定省级时,先获取的指定省级列表。",
* @OA\Parameter(name="page",in="query",description="页码",@OA\schema(type="int")),
* @OA\Parameter(name="search",in="query",description="门店名称或编码",@OA\schema(type="string")),
* @OA\Response(response="200",description="
* GUID:门店GUID,
* NAME:门店名称,
* CODE:门店编码,
* RECIVER_PROVINCE:所在省,
* RECIVER_CITY:所在市,
* RECIVER_REGION:所在区"),
* security={{"Authorization":{}}}
* )
*/
public
function
actionGetBranchesPackaging
()
{
$params
=
Yii
::
$app
->
request
->
queryParams
;
$model
=
new
ShopBranch
();
$model
->
scenario
=
'search'
;
$model
->
attributes
=
$params
;
if
(
!
$model
->
validate
())
{
Yii
::
$app
->
response
->
statusCode
=
422
;
return
$model
->
errors
;
}
$list
=
$model
->
provinceBranches
(
$model
->
search
);
if
(
!
$list
->
getModels
())
{
throw
new
BadRequestHttpException
(
'未找到符合条件的数据'
);
}
return
$list
;
}
/**
* @OA\Delete(
* path="/backend/web/v1/transport/transport-settings/transport-fee-del",
* tags={"配送管理"},
* summary="删除运费模板信息(侯贺政)",
* description="更新运费模板信息",
* @OA\Parameter(
* description="要删除的运费模板GUID",
* in="query",
* name="GUID",
* required=true,
* @OA\Schema(
* type="string",
* )
* ),
* @OA\Response(
* response=200,
* description="删除成功!"
* ),
* security={{"Authorization":{}}},
* )
*/
public
function
actionTransportFeeDel
()
{
$guid
=
Yii
::
$app
->
request
->
get
(
'GUID'
);
$model
=
new
$this
->
modelClass
();
$_model
=
$model
::
findOne
(
$guid
);
if
(
!
$_model
)
{
throw
new
BadRequestHttpException
(
"Requested resource does not exist !"
);
}
$userInfo
=
(
new
ShopRbacUser
)
->
getRbacUserInfo
(
Yii
::
$app
->
user
->
identity
->
GUID
);
if
(
$userInfo
[
'ROLE_ID'
]
==
USER_ROLE_REGION_ADMIN
&&
(
$userInfo
[
'BRANCH_GUID'
]
!=
$_model
[
'GROUP_GUID'
])
&&
(
$userInfo
[
'PARENT_BRANCH_GUID'
]
!=
$_model
[
'GROUP_GUID'
]))
{
throw
new
BadRequestHttpException
(
'不能删除总部或其他省级的运费模板!'
);
}
if
(
!
$_model
->
delete
())
{
throw
new
ServerErrorHttpException
(
'删除失败!'
);
}
throw
new
HttpException
(
200
,
"删除成功!"
);
}
}
}
backend/models/v1/branch/ShopBranch.php
View file @
1dd9be5f
This diff is collapsed.
Click to expand it.
backend/models/v1/transport/ShopPackagingcostsBranches.php
View file @
1dd9be5f
...
@@ -33,10 +33,10 @@ class ShopPackagingcostsBranches extends \app\models\v1\BaseModel
...
@@ -33,10 +33,10 @@ class ShopPackagingcostsBranches extends \app\models\v1\BaseModel
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'GUID'
],
'required'
],
[[
'GUID'
],
'required'
,
'on'
=>
[
'creation'
]
],
[[
'CREATE_TIME'
],
'safe'
],
[[
'CREATE_TIME'
],
'safe'
],
[[
'GUID'
,
'ORG_GUID'
,
'ACTIVITY_GUID'
,
'BRANCH_GUID'
,
'ACTIVITY_TYPE'
,
'YGROUP_CODE'
],
'string'
,
'max'
=>
50
],
[[
'GUID'
,
'ORG_GUID'
,
'ACTIVITY_GUID'
,
'BRANCH_GUID'
,
'ACTIVITY_TYPE'
,
'YGROUP_CODE'
],
'string'
,
'max'
=>
50
],
[[
'GUID'
],
'unique'
],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'creation'
]
],
];
];
}
}
...
...
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