客户
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\logic\UserLogic;
|
||||
use app\common\model\Corp;
|
||||
use app\crm\model\Country;
|
||||
|
||||
class UserService
|
||||
@@ -43,19 +44,24 @@ class UserService
|
||||
/**
|
||||
* 获取用户信息(包括菜单和权限)
|
||||
*/
|
||||
public function getUser(int $uid)
|
||||
public function getUser(int $uid, $corp_abbr)
|
||||
{
|
||||
$user = $this->logic->userInfo($uid);
|
||||
$corp_name = Corp::where('abbr', $corp_abbr)->value('name');
|
||||
$ossservice = new OssService();
|
||||
return [
|
||||
'id' => $user->id,
|
||||
'name' => $user->name,
|
||||
'position' => $user->position,
|
||||
'socialize' => $user->socialize,
|
||||
'socialize_pic' => $user->socialize_pic,
|
||||
'socialize_pic_full' => (!empty($user->socialize_pic))?$ossservice->generatePrivateUrl($user->socialize_pic):'',
|
||||
'country_id' => $user->country_id,
|
||||
'country_txt' => Country::where('id',$user->country_id)->value('cn_addr'),
|
||||
'avatar' => $user->avatar,
|
||||
'avatar_full' => (!empty($user->avatar))?$ossservice->generatePrivateUrl($user->avatar):'',
|
||||
'phone' => $user->phone,
|
||||
'corp_name' => $corp_name,
|
||||
'email' => $user->email,
|
||||
'status' => $user->status,
|
||||
'roles' => $user->roles->pluck('name')
|
||||
|
||||
Reference in New Issue
Block a user