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
563e7c1f
Commit
563e7c1f
authored
Dec 30, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
97eef00b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
AuthorityRoleController.php
backend/controllers/v1/authority/AuthorityRoleController.php
+2
-2
BranchController.php
backend/controllers/v1/branch/BranchController.php
+4
-4
BranchServiceTypeController.php
...end/controllers/v1/branch/BranchServiceTypeController.php
+3
-3
TransportInitialPriceController.php
...trollers/v1/transport/TransportInitialPriceController.php
+2
-2
No files found.
backend/controllers/v1/authority/AuthorityRoleController.php
View file @
563e7c1f
...
...
@@ -117,7 +117,7 @@ class AuthorityRoleController extends BaseController
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
201
);
}
elseif
(
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw
new
HttpException
(
500
,
'添加失败'
);
throw
new
HttpException
(
500
,
'添加失败'
);
}
return
$model
;
}
...
...
@@ -164,7 +164,7 @@ class AuthorityRoleController extends BaseController
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw
new
HttpException
(
500
,
'修改失败'
);
throw
new
HttpException
(
500
,
'修改失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
202
);
return
$model
;
...
...
backend/controllers/v1/branch/BranchController.php
View file @
563e7c1f
...
...
@@ -266,7 +266,7 @@ class BranchController extends BaseController
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
201
);
}
elseif
(
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw
new
HttpException
(
500
,
'添加失败'
);
throw
new
HttpException
(
500
,
'添加失败'
);
}
return
$model
;
}
...
...
@@ -548,7 +548,7 @@ class BranchController extends BaseController
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw
new
HttpException
(
500
,
'修改失败'
);
throw
new
HttpException
(
500
,
'修改失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
202
);
return
$model
;
...
...
@@ -583,7 +583,7 @@ class BranchController extends BaseController
throw
new
BadRequestHttpException
(
'没有找到要删除的记录'
);
}
else
if
(
$branchservice
->
delete
()
===
false
)
{
// throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');
throw
new
HttpException
(
500
,
'删除失败'
);
throw
new
HttpException
(
500
,
'删除失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
203
);
...
...
@@ -1105,7 +1105,7 @@ class BranchController extends BaseController
$model
->
setAttributes
(
Yii
::
$app
->
getRequest
()
->
post
());
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw
new
HttpException
(
500
,
'修改失败'
);
throw
new
HttpException
(
500
,
'修改失败'
);
}
return
$model
;
}
...
...
backend/controllers/v1/branch/BranchServiceTypeController.php
View file @
563e7c1f
...
...
@@ -146,7 +146,7 @@ class BranchServiceTypeController extends BaseController
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
201
);
}
elseif
(
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
throw
new
HttpException
(
500
,
'添加失败'
);
throw
new
HttpException
(
500
,
'添加失败'
);
}
return
$model
;
}
...
...
@@ -187,7 +187,7 @@ class BranchServiceTypeController extends BaseController
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw
new
HttpException
(
500
,
'修改失败'
);
throw
new
HttpException
(
500
,
'修改失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
202
);
return
$model
;
...
...
@@ -222,7 +222,7 @@ class BranchServiceTypeController extends BaseController
throw
new
BadRequestHttpException
(
'没有找到要删除的记录'
);
}
else
if
(
$branchservice
->
delete
()
===
false
)
{
// throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');
throw
new
HttpException
(
500
,
'删除失败'
);
throw
new
HttpException
(
500
,
'删除失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
203
);
...
...
backend/controllers/v1/transport/TransportInitialPriceController.php
View file @
563e7c1f
...
...
@@ -136,7 +136,7 @@ class TransportInitialPriceController extends BaseController
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
// throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
throw
new
HttpException
(
500
,
'修改失败'
);
throw
new
HttpException
(
500
,
'修改失败'
);
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
202
);
return
$model
;
...
...
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