diff --git a/common/models/UserCard.php b/common/models/UserCard.php index 97e790a..b3ff1b3 100755 --- a/common/models/UserCard.php +++ b/common/models/UserCard.php @@ -379,4 +379,8 @@ class UserCard extends \yii\db\ActiveRecord return UserCard::find()->where([ 'IN', 'id_user', $usersId])->all(); } + + public static function getCardByStatus($status_id){ + + } } diff --git a/frontend/modules/api/controllers/FileController.php b/frontend/modules/api/controllers/FileController.php index 01051e0..b48c6f1 100644 --- a/frontend/modules/api/controllers/FileController.php +++ b/frontend/modules/api/controllers/FileController.php @@ -186,7 +186,7 @@ class FileController extends ApiController * * @OA\RequestBody( * @OA\MediaType( - * mediaType="multipart/form-data", + * mediaType="application/x-www-form-urlencoded", * @OA\Schema( * required={"file_id", "entity_type", "entity_id"}, * @OA\Property( @@ -232,14 +232,14 @@ class FileController extends ApiController */ public function actionDetach(): FileEntity { - $request = \Yii::$app->request->post(); + $request = \Yii::$app->request->getBodyParams(); $file = File::findOne($request['file_id']); if (!$file) { throw new NotFoundHttpException('File bot found'); } - $fileEntity = new FileEntity(); - $fileEntity->load($request, ''); + $fileEntity = FileEntity::findOne(['file_id' => $request['file_id'], 'entity_type' => $request['entity_type'], 'entity_id' => $request['entity_id']]); + //$fileEntity->load($request, ''); $fileEntity->status = FileEntity::STATUS_DISABLE; if (!$fileEntity->validate()) {