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
765647a7
authored
Oct 11, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
好友主力的头像问题
parent
993f9f8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
app/Http/Controllers/AssistsController.php
app/Services/AssistService.php
app/Http/Controllers/AssistsController.php
View file @
765647a7
...
@@ -48,10 +48,11 @@ class AssistsController extends Controller
...
@@ -48,10 +48,11 @@ class AssistsController extends Controller
$userExchangeService
=
new
UserExchangeService
();
$userExchangeService
=
new
UserExchangeService
();
$userExchange
=
array_get
(
$userExchangeService
->
getUserExchange
([
'id'
=>
$exchangeId
]),
'data'
);
$userExchange
=
array_get
(
$userExchangeService
->
getUserExchange
([
'id'
=>
$exchangeId
]),
'data'
);
$result
[
'data'
][
'amount'
]
=
array_get
(
$userExchange
,
'amount'
,
'0'
);
$result
[
'data'
][
'amount'
]
=
array_get
(
$userExchange
,
'amount'
,
'0'
);
$temp
=
array_get
(
$userExchange
,
'user_id'
);
$userId
=
array_get
(
$userExchange
,
'user_id'
);
$user
=
$this
->
service
->
getUserInfo
(
$temp
);
$user
=
$this
->
service
->
getUserInfo
(
$userId
);
$userAvatar
=
!
empty
(
$user
[
'wechat_oauth'
][
'oauth_head'
])
?
$user
[
'wechat_oauth'
][
'oauth_head'
]
:
''
;
$result
[
'data'
][
'user_info'
]
=
[
$result
[
'data'
][
'user_info'
]
=
[
'avatar'
=>
array_get
(
$user
,
'avatar'
,
''
),
'avatar'
=>
$userAvatar
?:
array_get
(
$user
,
'avatar'
,
''
),
'company_name'
=>
array_get
(
$user
,
'company_name'
,
$user
[
'mobile'
]),
'company_name'
=>
array_get
(
$user
,
'company_name'
,
$user
[
'mobile'
]),
'user_id'
=>
array_get
(
$user
,
'user_id'
,
''
),
'user_id'
=>
array_get
(
$user
,
'user_id'
,
''
),
];
];
...
...
app/Services/AssistService.php
View file @
765647a7
...
@@ -20,8 +20,11 @@ class AssistService extends BaseService
...
@@ -20,8 +20,11 @@ class AssistService extends BaseService
$users
=
$this
->
getUsersFromRedis
(
$ids
);
$users
=
$this
->
getUsersFromRedis
(
$ids
);
foreach
(
$users
as
$user
)
{
foreach
(
$users
as
$user
)
{
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
$userNames
[
$user
[
'user_id'
]]
=
isset
(
$user
[
'company_name'
])
?:
$user
[
'mobile'
];
$userAvatars
[
$user
[
'user_id'
]]
=
$user
[
'avatar'
];
//微信头像
$weixinAvatar
=
!
empty
(
$user
[
'wechat_oauth'
][
'oauth_head'
])
?
$user
[
'wechat_oauth'
][
'oauth_head'
]
:
''
;
$userAvatars
[
$user
[
'user_id'
]]
=
$weixinAvatar
?
:
$user
[
'avatar'
];
}
}
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
,
$userAvatars
)
{
$result
[
'data'
]
=
array_map
(
function
(
$value
)
use
(
$userNames
,
$userAvatars
)
{
$value
[
'assist_user_name'
]
=
$userNames
[
$value
[
'assist_user_id'
]];
$value
[
'assist_user_name'
]
=
$userNames
[
$value
[
'assist_user_id'
]];
$value
[
'assist_user_avatar'
]
=
$userAvatars
[
$value
[
'assist_user_id'
]];
$value
[
'assist_user_avatar'
]
=
$userAvatars
[
$value
[
'assist_user_id'
]];
...
...
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