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
9dc35d24
Commit
9dc35d24
authored
Nov 15, 2019
by
侯贺政
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店评分删除
Signed-off-by:
houhezheng
<
houhezheng@romens.cn
>
parent
72893245
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
urlmanager.php
backend/config/urlmanager.php
+2
-0
BranchController.php
backend/controllers/v1/branch/BranchController.php
+38
-2
ShopBranchScore.php
backend/models/v1/branch/ShopBranchScore.php
+4
-4
No files found.
backend/config/urlmanager.php
View file @
9dc35d24
...
...
@@ -36,6 +36,8 @@ return [
'GET,OPTIONS branch-score-list'
=>
'branch-score-list'
,
'GET,OPTIONS score-info'
=>
'score-info'
,
'PUT,OPTIONS score-info-update'
=>
'score-info-update'
,
'DELETE,OPTIONS score-info-del'
=>
'score-info-del'
,
'POST,OPTIONS add-branch-score'
=>
'add-branch-score'
,
'GET,OPTIONS branch-service-list'
=>
'branch-service-list'
,
'POST,OPTIONS add-branch-service'
=>
'add-branch-service'
,
'PUT,OPTIONS revise-branch-service'
=>
'revise-branch-service'
,
...
...
backend/controllers/v1/branch/BranchController.php
View file @
9dc35d24
...
...
@@ -16,7 +16,7 @@ class BranchController extends BaseController
* @OA\GET(
* path="/backend/web/v1/branch/branches/branch-score-list",
* tags={"门店&DC"},
* summary="门店评价
管理
(侯贺政)",
* summary="门店评价
列表
(侯贺政)",
* description="门店服务打分列表",
* @OA\Parameter(name="BRANCH_CODE",in="query",description="门店编号",@OA\Schema(type="string")),
* @OA\Parameter(name="ARTIFICIAL_NUMBER",in="query",description="导入人工号",@OA\Schema(type="string")),
...
...
@@ -154,7 +154,7 @@ class BranchController extends BaseController
$params
=
Yii
::
$app
->
request
->
bodyParams
;
$model
=
ShopBranchScore
::
findOne
(
$params
[
'GUID'
]);
if
(
!
$model
)
{
throw
new
BadRequestHttpException
(
'
Please check if your request is correc
t !'
);
throw
new
BadRequestHttpException
(
'
Requested resource does not exis
t !'
);
}
$model
->
attributes
=
$params
;
...
...
@@ -169,4 +169,40 @@ class BranchController extends BaseController
return
[
'code'
=>
200
,
'message'
=>
'保存成功!'
];
}
/**
* @OA\Delete(
* path="/backend/web/v1/branch/branches/score-info-del",
* tags={"门店&DC"},
* summary="门店服务评价删除(侯贺政)",
* description="门店服务打分删除",
* @OA\Parameter(
* description="要删除的门店服务评价GUID",
* in="query",
* name="guid",
* required=true,
* @OA\Schema(
* type="string",
* )
* ),
* @OA\Response(
* response=400,
* description="Invalid ID supplied"
* ),
* security={{"Authorization":{}}},
* )
*/
public
function
actionScoreInfoDel
(
$guid
)
{
$model
=
ShopBranchScore
::
findOne
(
$guid
);
if
(
!
$model
)
{
throw
new
BadRequestHttpException
(
"Requested resource does not exist !"
);
}
if
(
!
$model
->
delete
())
{
throw
new
ServerErrorHttpException
(
'删除失败!'
);
}
return
[
'code'
=>
200
,
'message'
=>
'删除成功!'
];
}
}
backend/models/v1/branch/ShopBranchScore.php
View file @
9dc35d24
...
...
@@ -45,7 +45,7 @@ class ShopBranchScore extends BaseModel
[[
'GUID'
,
'BRANCH_CODE'
,
'BRANCH_NAME'
],
'string'
,
'max'
=>
50
],
[[
'ARTIFICIAL_NUMBER'
],
'string'
,
'max'
=>
12
],
[[
'ARTIFICIAL_NAME'
],
'string'
,
'max'
=>
20
],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'creation'
]],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'creation'
]],
];
}
...
...
@@ -84,11 +84,11 @@ class ShopBranchScore extends BaseModel
->
leftJoin
(
'shop_branch sb'
,
'sbs.BRANCH_CODE=sb.CODE'
);
if
(
isset
(
$params
[
'BRANCH_CODE'
]))
{
$query
->
andfilterWhere
([
'like'
,
'sbs.BRANCH_CODE'
,
$params
[
'BRANCH_CODE'
]]);
$query
->
andfilterWhere
([
'like'
,
'sbs.BRANCH_CODE'
,
$params
[
'BRANCH_CODE'
]]);
}
if
(
isset
(
$params
[
'ARTIFICIAL_NUMBER'
]))
{
$query
->
andfilterWhere
([
'like'
,
'sbs.ARTIFICIAL_NUMBER'
,
$params
[
'ARTIFICIAL_NUMBER'
]]);
$query
->
andfilterWhere
([
'like'
,
'sbs.ARTIFICIAL_NUMBER'
,
$params
[
'ARTIFICIAL_NUMBER'
]]);
}
return
new
ActiveDataProvider
([
...
...
@@ -114,7 +114,7 @@ class ShopBranchScore extends BaseModel
{
$info
=
static
::
find
()
->
select
(
'GUID,BRANCH_NAME,BRANCH_CODE,BASIC_SERVICES,QUALITY_ASSURANCE,OPERATION_MANAGEMENT,STORE_IMAGE,ELECTRICITY_MANAGEMENT,CUSTOMERE_VALUATION,STORE_CONFIGURATION,ARTIFICIAL_NUMBER,ARTIFICIAL_NAME'
)
->
where
([
'GUID'
=>
$id
])
->
where
([
'GUID'
=>
$id
])
->
one
();
return
$info
;
...
...
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