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
7502971d
Commit
7502971d
authored
Jan 02, 2020
by
姚书霞
🐘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置相应主体
parent
1cd5eeb3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
BaseController.php
backend/controllers/v1/BaseController.php
+2
-1
CompanyController.php
backend/controllers/v1/transport/CompanyController.php
+3
-2
No files found.
backend/controllers/v1/BaseController.php
View file @
7502971d
...
@@ -22,7 +22,7 @@ use backend\components\v1\authorizationFilter;
...
@@ -22,7 +22,7 @@ use backend\components\v1\authorizationFilter;
* ),
* ),
* @OA\Server(
* @OA\Server(
* description="Api server",
* description="Api server",
* url="/
guoyongzhi/weiShopNew
",
* url="/
yaoshuxia/shopback
",
* ),
* ),
* @OA\SecurityScheme(
* @OA\SecurityScheme(
* securityScheme="Authorization",
* securityScheme="Authorization",
...
@@ -60,6 +60,7 @@ class BaseController extends ActiveController
...
@@ -60,6 +60,7 @@ class BaseController extends ActiveController
public
$serializer
=
[
public
$serializer
=
[
'class'
=>
'yii\rest\Serializer'
,
'class'
=>
'yii\rest\Serializer'
,
'collectionEnvelope'
=>
'data'
,
'collectionEnvelope'
=>
'data'
,
'preserveKeys'
=>
true
,
];
];
public
function
behaviors
()
public
function
behaviors
()
{
{
...
...
backend/controllers/v1/transport/CompanyController.php
View file @
7502971d
...
@@ -74,10 +74,11 @@ class CompanyController extends BaseController
...
@@ -74,10 +74,11 @@ class CompanyController extends BaseController
public
function
actionCompanyDetail
()
public
function
actionCompanyDetail
()
{
{
$guid
=
Yii
::
$app
->
request
->
getQueryparam
(
'guid'
);
$guid
=
Yii
::
$app
->
request
->
getQueryparam
(
'guid'
);
$result
=
$this
->
modelClass
::
findOne
(
$guid
)
->
toArray
();
$result
=
$this
->
modelClass
::
findOne
(
$guid
);
if
(
!
$result
)
throw
new
HttpException
(
400
,
'记录不存在'
);
return
new
ActiveDataProvider
(
return
new
ActiveDataProvider
(
[
[
'models'
=>
$result
,
'models'
=>
$result
->
toArray
()
,
'pagination'
=>
false
'pagination'
=>
false
]
]
);
);
...
...
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