细节调整
Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
parent
6743a6023f
commit
76e4b9712c
@ -30,16 +30,16 @@ class Member extends CommonModel
|
|||||||
$organizationList = [];
|
$organizationList = [];
|
||||||
if ($list) {
|
if ($list) {
|
||||||
foreach ($list as &$item) {
|
foreach ($list as &$item) {
|
||||||
$departments = '';
|
$departments = [];
|
||||||
$departmentCodes = $item['department_code'];
|
$departmentCodes = $item['department_code'];
|
||||||
if ($departmentCodes) {
|
if ($departmentCodes) {
|
||||||
$departmentCodes = explode(',', $departmentCodes);
|
$departmentCodes = explode(',', $departmentCodes);
|
||||||
foreach ($departmentCodes as $departmentCode) {
|
foreach ($departmentCodes as $departmentCode) {
|
||||||
$department = Department::where(['code' => $departmentCode])->field('name')->find();
|
$department = Department::where(['code' => $departmentCode])->field('name')->find();
|
||||||
$departments .= "{$department['name']} ";
|
$departments[] = $department['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$item['department'] = $departments;
|
$item['department'] = implode(' - ', $departments);
|
||||||
$organization = Organization::where(['code' => $item['organization_code']])->find();
|
$organization = Organization::where(['code' => $item['organization_code']])->find();
|
||||||
if ($organization) {
|
if ($organization) {
|
||||||
$organizationList[] = $organization;
|
$organizationList[] = $organization;
|
||||||
@ -50,7 +50,7 @@ class Member extends CommonModel
|
|||||||
$member['is_owner'] = $list[0]['is_owner'];
|
$member['is_owner'] = $list[0]['is_owner'];
|
||||||
$member['authorize'] = $list[0]['authorize'];
|
$member['authorize'] = $list[0]['authorize'];
|
||||||
$member['position'] = $list[0]['position'];
|
$member['position'] = $list[0]['position'];
|
||||||
$member['department'] = $list[0]['department'];
|
$member['department'] = implode(' - ', $list[0]['department']);
|
||||||
|
|
||||||
setCurrentMember($member);
|
setCurrentMember($member);
|
||||||
!empty($member['authorize']) && NodeService::applyProjectAuthNode();
|
!empty($member['authorize']) && NodeService::applyProjectAuthNode();
|
||||||
|
@ -78,16 +78,16 @@ class Account extends BasicApi
|
|||||||
if ($memberInfo) {
|
if ($memberInfo) {
|
||||||
$item['avatar'] = $memberInfo['avatar'];
|
$item['avatar'] = $memberInfo['avatar'];
|
||||||
}
|
}
|
||||||
$departments = '';
|
$departments = [];
|
||||||
$departmentCodes = $item['department_code'];
|
$departmentCodes = $item['department_code'];
|
||||||
if ($departmentCodes) {
|
if ($departmentCodes) {
|
||||||
$departmentCodes = explode(',', $departmentCodes);
|
$departmentCodes = explode(',', $departmentCodes);
|
||||||
foreach ($departmentCodes as $departmentCode) {
|
foreach ($departmentCodes as $departmentCode) {
|
||||||
$department = \app\common\Model\Department::where(['code' => $departmentCode])->field('name')->find();
|
$department = \app\common\Model\Department::where(['code' => $departmentCode])->field('name')->find();
|
||||||
$departments .= "{$department['name']} ";
|
$departments[] = $department['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$item['departments'] = $departments;
|
$item['departments'] = implode(' - ', $departments);
|
||||||
}
|
}
|
||||||
unset($item);
|
unset($item);
|
||||||
}
|
}
|
||||||
@ -103,16 +103,16 @@ class Account extends BasicApi
|
|||||||
}
|
}
|
||||||
$memberAccount = $this->model->where(['code' => $code])->field('id', true)->find();
|
$memberAccount = $this->model->where(['code' => $code])->field('id', true)->find();
|
||||||
if ($memberAccount) {
|
if ($memberAccount) {
|
||||||
$departments = '';
|
$departments = [];
|
||||||
$departmentCodes = $memberAccount['department_code'];
|
$departmentCodes = $memberAccount['department_code'];
|
||||||
if ($departmentCodes) {
|
if ($departmentCodes) {
|
||||||
$departmentCodes = explode(',', $departmentCodes);
|
$departmentCodes = explode(',', $departmentCodes);
|
||||||
foreach ($departmentCodes as $departmentCode) {
|
foreach ($departmentCodes as $departmentCode) {
|
||||||
$department = \app\common\Model\Department::where(['code' => $departmentCode])->field('name')->find();
|
$department = \app\common\Model\Department::where(['code' => $departmentCode])->field('name')->find();
|
||||||
$departments .= "{$department['name']} ";
|
$departments[] = $department['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$memberAccount['departments'] = $departments;
|
$memberAccount['departments'] = implode(' - ', $departments);
|
||||||
}
|
}
|
||||||
$this->success('', $memberAccount);
|
$this->success('', $memberAccount);
|
||||||
}
|
}
|
||||||
|
@ -60,17 +60,17 @@ class Index extends BasicApi
|
|||||||
$memberAccount = MemberAccount::where(['member_code' => $member['code'], 'organization_code' => $organizationCode])->find();
|
$memberAccount = MemberAccount::where(['member_code' => $member['code'], 'organization_code' => $organizationCode])->find();
|
||||||
$member = Member::where(['account' => $member['account']])->order('id asc')->find()->toArray();
|
$member = Member::where(['account' => $member['account']])->order('id asc')->find()->toArray();
|
||||||
|
|
||||||
$departments = '';
|
$departments = [];
|
||||||
$departmentCodes = $memberAccount['department_code'];
|
$departmentCodes = $memberAccount['department_code'];
|
||||||
if ($departmentCodes) {
|
if ($departmentCodes) {
|
||||||
$departmentCodes = explode(',', $departmentCodes);
|
$departmentCodes = explode(',', $departmentCodes);
|
||||||
foreach ($departmentCodes as $departmentCode) {
|
foreach ($departmentCodes as $departmentCode) {
|
||||||
$department = Department::where(['code' => $departmentCode])->field('name')->find();
|
$department = Department::where(['code' => $departmentCode])->field('name')->find();
|
||||||
$departments .= "{$department['name']} ";
|
$departments[] = $department['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$member['position'] = $memberAccount['position'];
|
$member['position'] = $memberAccount['position'];
|
||||||
$member['department'] = $departments;
|
$member['department'] = implode(' - ', $departments);
|
||||||
$member['account_id'] = $memberAccount['id'];
|
$member['account_id'] = $memberAccount['id'];
|
||||||
$member['is_owner'] = $memberAccount['is_owner'];
|
$member['is_owner'] = $memberAccount['is_owner'];
|
||||||
$member['authorize'] = $memberAccount['authorize'];
|
$member['authorize'] = $memberAccount['authorize'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user