Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_welfare_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cd830dc7
authored
Sep 29, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix åbug
parent
8e9fbb00
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
app/Services/InviteService.php
app/Services/InviteService.php
View file @
cd830dc7
...
...
@@ -13,22 +13,25 @@ class InviteService extends BaseService
$result
=
json_decode
(
$result
,
true
);
//需要处理一下数据,因为要获得被邀请人的名称(即是公司名称),如果没有名称,那就显示手机号码
$userNames
=
[];
$userNames
=
$mobiles
=
[];
if
(
isset
(
$result
[
'data'
])
&&
$result
[
'data'
])
{
//获取到被邀请人的信息
$ids
=
array_column
(
$result
[
'data'
],
'invited_user_id'
);
$users
=
$this
->
getUsersFromRedis
(
$ids
);
foreach
(
$users
as
$user
)
{
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
if
(
isset
(
$user
[
'user_id'
]))
{
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
&&!
empty
(
$user
[
'company_name'
])
?
$user
[
'company_name'
]
:
$user
[
'mobile'
];
$mobiles
[
$user
[
'user_id'
]]
=
$user
[
'mobile'
];
}
}
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
,
$mobiles
)
{
$value
[
'invited_user_name'
]
=
$userNames
[
$value
[
'invited_user_id'
]]
;
$value
[
'invited_user_mobile'
]
=
$mobiles
[
$value
[
'invited_user_id'
]]
;
$value
[
'invited_user_name'
]
=
array_get
(
$userNames
,
$value
[
'invited_user_id'
])
;
$value
[
'invited_user_mobile'
]
=
array_get
(
$mobiles
,
$value
[
'invited_user_id'
])
;
$value
[
'add_time'
]
=
date
(
'Y-m-d H:i'
);
return
$value
;
},
$result
[
'data'
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment