quick fix profile
This commit is contained in:
parent
8413043573
commit
866389a95a
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace common\services;
|
namespace common\services;
|
||||||
|
|
||||||
|
use common\classes\Debug;
|
||||||
use common\models\Manager;
|
use common\models\Manager;
|
||||||
use common\models\ManagerEmployee;
|
use common\models\ManagerEmployee;
|
||||||
use common\models\UserCard;
|
use common\models\UserCard;
|
||||||
@ -15,11 +16,11 @@ class ProfileService
|
|||||||
/**
|
/**
|
||||||
* @throws ServerErrorHttpException
|
* @throws ServerErrorHttpException
|
||||||
*/
|
*/
|
||||||
public static function getMainData($user_id): array
|
public static function getMainData($user_id)//: array
|
||||||
{
|
{
|
||||||
$userCard = UserCard::findOne(['id_user' => $user_id]);
|
$userCard = UserCard::findOne(['id_user' => $user_id]);
|
||||||
if (empty($userCard)) {
|
if (empty($userCard)) {
|
||||||
throw new ServerErrorHttpException(json_encode($userCard->errors));
|
throw new ServerErrorHttpException(json_encode('Profile not found!'));
|
||||||
}
|
}
|
||||||
return array('fio' => $userCard->fio,
|
return array('fio' => $userCard->fio,
|
||||||
'photo' => $userCard->photo,
|
'photo' => $userCard->photo,
|
||||||
|
Loading…
Reference in New Issue
Block a user