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
c293438f
Commit
c293438f
authored
Nov 14, 2019
by
姚书霞
🐘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除方法
parent
669c2fb5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
ShopUserMembergradeController.php
...controllers/v1/shopuser/ShopUserMembergradeController.php
+36
-4
No files found.
backend/controllers/v1/shopuser/ShopUserMembergradeController.php
View file @
c293438f
...
...
@@ -104,11 +104,9 @@ class ShopUserMembergradeController extends BaseController
$model
->
setAttributes
(
$other_param
);
$model
->
setAttributes
(
Yii
::
$app
->
getRequest
()
->
post
());
// $model->attributes = $other_param;
// print_r($model);die;
if
(
$model
->
save
())
{
$response
=
Yii
::
$app
->
getResponse
();
$response
->
setStatusCode
(
201
);
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
201
);
}
elseif
(
!
$model
->
hasErrors
())
{
throw
new
ServerErrorHttpException
(
'Failed to create the object for unknown reason.'
);
}
...
...
@@ -157,4 +155,38 @@ class ShopUserMembergradeController extends BaseController
return
$model
;
}
/**
* @OA\DELETE(
* path="/backend/web/v1/shopuser/shop-user-membergrades/del",
* tags={"用户&员工接口"},
* summary="删除用户组接口(姚书侠)",
* description="删除用户组接口",
* @OA\RequestBody(
* required=true,
* @OA\MediaType(
* mediaType="application/x-www-form-urlencoded",
* @OA\Schema(
* type="object",
* @OA\Property(property="GUID",description="要删除的用户组GUID",type="string"),
* )
* )
* ),
* @OA\Response(response=200,description="成功时返回access-token"),
* security={{"Authorization": {}}}
* )
*/
public
function
actionDel
()
{
$guid
=
Yii
::
$app
->
getRequest
()
->
post
(
'GUID'
);
$model
=
$this
->
modelClass
::
findOne
(
$guid
);
if
(
!
$model
){
throw
new
BadRequestHttpException
(
'没有找到要修改的记录'
);
}
else
if
(
$model
->
delete
()
===
false
)
{
throw
new
ServerErrorHttpException
(
'Failed to delete the object for unknown reason.'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
204
);
return
$model
;
}
}
\ 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