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

配置相应主体

parent 1cd5eeb3
......@@ -22,7 +22,7 @@ use backend\components\v1\authorizationFilter;
* ),
* @OA\Server(
* description="Api server",
* url="/guoyongzhi/weiShopNew",
* url="/yaoshuxia/shopback",
* ),
* @OA\SecurityScheme(
* securityScheme="Authorization",
......@@ -60,6 +60,7 @@ class BaseController extends ActiveController
public $serializer = [
'class' => 'yii\rest\Serializer',
'collectionEnvelope' => 'data',
'preserveKeys'=>true,
];
public function behaviors()
{
......
......@@ -74,10 +74,11 @@ class CompanyController extends BaseController
public function actionCompanyDetail()
{
$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(
[
'models' => $result,
'models' => $result->toArray(),
'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