Commit 7502971d authored by 姚书霞's avatar 姚书霞 🐘

配置相应主体

parent 1cd5eeb3
...@@ -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()
{ {
......
...@@ -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
] ]
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment