增加业务强制绑定提醒
This commit is contained in:
@@ -5,6 +5,8 @@ namespace app\common\service;
|
||||
use app\common\logic\UserLogic;
|
||||
use app\common\model\Corp;
|
||||
use app\common\model\User;
|
||||
use app\common\model\UserGroup;
|
||||
use app\common\model\UserGroupMembers;
|
||||
use app\common\traits\crud\CrudLogicTrait;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\utils\CrudUtil;
|
||||
@@ -68,6 +70,27 @@ class UserService
|
||||
public function getUser(int $uid, $corp_abbr)
|
||||
{
|
||||
$user = $this->logic->userInfo($uid);
|
||||
|
||||
// 查找直属上级 10.13 add
|
||||
$reportToInfo = [];
|
||||
if ($user->reportToInfo) {
|
||||
$reportToInfo = [
|
||||
'id' => $user->reportToInfo->id,
|
||||
'name' => $user->reportToInfo->name
|
||||
];
|
||||
}
|
||||
|
||||
// 查找绑定内勤 10.13 add
|
||||
$officeClerkInfo = [];
|
||||
$ugm = UserGroupMembers::where('user_id', $uid)->where('status', 1)->first();
|
||||
if ($ugm) {
|
||||
$lugm = UserGroupMembers::where('group_id', $ugm->group_id)->where('is_leader', 1)->first();
|
||||
if ($lugm) {
|
||||
$officeClerkInfo['id'] = $lugm->user_id;
|
||||
$officeClerkInfo['name'] = User::where('id', $lugm->user_id)->value('name');
|
||||
}
|
||||
}
|
||||
|
||||
$corp_name = Corp::where('abbr', $corp_abbr)->value('name');
|
||||
$ossservice = new OssService();
|
||||
return [
|
||||
@@ -90,6 +113,8 @@ class UserService
|
||||
'roles' => $user->roles->pluck('name'),
|
||||
'sign_img' => $user->sign_img,
|
||||
'sign_img_url' => (!empty($user->sign_img))?$ossservice->generatePrivateUrl($user->sign_img):'',
|
||||
'report_to_info' => $reportToInfo,
|
||||
'office_clerk_info' => $officeClerkInfo
|
||||
];
|
||||
}
|
||||
|
||||
@@ -126,9 +151,9 @@ class UserService
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
public function getList()
|
||||
public function getList(Request $request)
|
||||
{
|
||||
return $this->logic->getList();
|
||||
return $this->logic->getList($request);
|
||||
}
|
||||
|
||||
/** 分页列表 */
|
||||
|
||||
Reference in New Issue
Block a user