fix request profiles

This commit is contained in:
Kavalar 2023-04-18 17:34:26 +03:00
parent d2de940aa3
commit 5ea572e698
2 changed files with 12 additions and 3 deletions

View File

@ -198,8 +198,9 @@ class RequestService
}
$q = UserCard::find()->select('user_card.id, fio, user_card.position_id, card_skill.skill_id')
$q = UserCard::find()->select('user_card.id, fio, photo, position.name as position_title, user_card.position_id, user_card.level, card_skill.skill_id')
->leftJoin('card_skill', 'card_skill.card_id = user_card.id')
->leftJoin('position', 'user_card.position_id = position.id')
->where(['deleted_at' => null])
->andWhere(['status' => [4, 12]])
->andWhere(['not', ['position_id' => null]]);

View File

@ -112,8 +112,8 @@ namespace frontend\modules\api\models;
* schema="RequestsProfileSearchExample",
* type="array",
* example={
* {"id": 23, "fio": "Иванов Иван Иванович", "position_id": "1", "skill_id": "1"},
* {"id": 24, "fio": "Петров Петр Петрович", "position_id": "2", "skill_id": "1"}
* {"id": 23, "fio": "Иванов Иван Иванович", "photo": "/profileava/m5.png", "position_title": "Back end - разработчик", "position_id": "1", "level": "2", "skill_id": "1"},
* {"id": 24, "fio": "Петров Петр Петрович", "photo": "/profileava/m2.png", "position_title": "Back end - разработчик", "position_id": "2", "level": "4", "skill_id": "1"}
* },
* @OA\Items(
* type="object",
@ -126,10 +126,18 @@ namespace frontend\modules\api\models;
* type="string",
* ),
* @OA\Property(
* property="photo",
* type="string",
* ),
* @OA\Property(
* property="position_id",
* type="integer",
* ),
* @OA\Property(
* property="level",
* type="integer",
* ),
* @OA\Property(
* property="skill_id",
* type="integer",
* ),