edit request, skills list, position list
This commit is contained in:
@ -4,6 +4,7 @@ namespace common\services;
|
||||
|
||||
use common\models\Manager;
|
||||
use common\models\ManagerEmployee;
|
||||
use common\models\Position;
|
||||
use common\models\UserCard;
|
||||
use common\models\UserCardPortfolioProjects;
|
||||
use frontend\modules\api\models\ProfileSearchForm;
|
||||
@ -84,6 +85,14 @@ class ProfileService
|
||||
throw new ServerErrorHttpException('There is no user with this id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|\yii\db\ActiveRecord[]
|
||||
*/
|
||||
public static function getPositionsList()
|
||||
{
|
||||
return Position::find()->all();
|
||||
}
|
||||
|
||||
private static function addPermission(&$profile, $user_card_id)
|
||||
{
|
||||
$searcherCardID = self::getSearcherCardID(Yii::$app->user->getId());
|
||||
|
@ -146,7 +146,7 @@ class RequestService
|
||||
*/
|
||||
public function getByUserId($user_id)
|
||||
{
|
||||
return $this->model->find()->where(['user_id' => $user_id])->all();
|
||||
return $this->model->find()->where(['user_id' => $user_id, 'status' => 1])->all();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,6 +160,19 @@ class RequestService
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $userId
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUser(int $userId): bool
|
||||
{
|
||||
if ($this->model->user_id == $userId){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|int
|
||||
*/
|
||||
|
Reference in New Issue
Block a user