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
d0625c27
authored
Aug 30, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加用户名称返回
parent
9310d100
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
app/Http/Controllers/InvitesController.php
app/Services/AssistService.php
app/Services/InviteService.php
app/Http/Controllers/InvitesController.php
View file @
d0625c27
...
@@ -37,6 +37,8 @@ class InvitesController extends Controller
...
@@ -37,6 +37,8 @@ class InvitesController extends Controller
if
(
!
$invitedUserId
)
{
if
(
!
$invitedUserId
)
{
return
$this
->
Export
(
self
::
INVALID_PARAMETER
);
return
$this
->
Export
(
self
::
INVALID_PARAMETER
);
}
}
//注意invited_user_id指的是点击邀请好友链接的用户id
$map
=
[
$map
=
[
'user_id'
=>
$userId
,
'user_id'
=>
$userId
,
'invited_user_id'
=>
$invitedUserId
,
'invited_user_id'
=>
$invitedUserId
,
...
...
app/Services/AssistService.php
View file @
d0625c27
...
@@ -4,13 +4,28 @@
...
@@ -4,13 +4,28 @@
namespace
App\Services
;
namespace
App\Services
;
class
AssistService
class
AssistService
extends
BaseService
{
{
public
function
getAssistList
(
$map
=
[])
public
function
getAssistList
(
$map
=
[])
{
{
$url
=
config
(
'website.BaseUrl'
)
.
'/assists/list'
;
$url
=
config
(
'website.BaseUrl'
)
.
'/assists/list'
;
$result
=
reportCurl
(
$url
,
$map
,
true
);
$result
=
reportCurl
(
$url
,
$map
,
true
);
$result
=
json_decode
(
$result
,
true
);
$result
=
json_decode
(
$result
,
true
);
$userNames
=
[];
if
(
isset
(
$result
[
'data'
])
&&
$result
[
'data'
])
{
//获取到被邀请人的信息
$ids
=
array_column
(
$result
[
'data'
],
'assist_user_id'
);
$users
=
$this
->
getUsersFromRedis
(
$ids
);
foreach
(
$users
as
$user
)
{
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
}
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
)
{
$value
[
'assist_user_name'
]
=
$userNames
[
$value
[
'assist_user_id'
]];
return
$value
;
},
$result
[
'data'
]);
}
return
$result
;
return
$result
;
}
}
...
...
app/Services/InviteService.php
View file @
d0625c27
...
@@ -22,7 +22,7 @@ class InviteService extends BaseService
...
@@ -22,7 +22,7 @@ class InviteService extends BaseService
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
}
}
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
)
{
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
)
{
$value
[
'invited_user_
mobil
e'
]
=
$userNames
[
$value
[
'invited_user_id'
]];
$value
[
'invited_user_
nam
e'
]
=
$userNames
[
$value
[
'invited_user_id'
]];
return
$value
;
return
$value
;
...
...
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