Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
e5f55e16
...
e5f55e161776d52fbeec4d5774bbf8db2452ea2a
authored
2022-04-13 10:28:38 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
129aac98
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
29 deletions
app/Http/Middleware/AuthIdentifier.php
app/Services/MusicianAgreementService.php
app/Services/V2/MusicianSongService.php
app/Http/Middleware/AuthIdentifier.php
View file @
e5f55e1
...
...
@@ -51,6 +51,7 @@ class AuthIdentifier
//通过身份证查询id
$stakeholder_ids
=
Stakeholder
::
stakeholderIds
(
$identifier
);
if
(
empty
(
$stakeholder_ids
))
return
Response
::
error
(
ErrorCode
::
MATCH_IDENTIFIER_FAIL
);
$request
->
attributes
->
add
([
...
...
app/Services/MusicianAgreementService.php
View file @
e5f55e1
...
...
@@ -52,34 +52,6 @@ class MusicianAgreementService extends Service
{
$client
=
new
CosHelper
();
$treaty
=
Treaty
::
query
()
->
whereIn
(
'party_b'
,
$this
->
stakeholder_ids
)
->
with
([
'filesNew:id,key,link_id'
])
->
select
([
'id'
,
'treaty_no as no'
,
'treaty_type'
,
'treaty_name as name'
,
'effective_date'
,
'deadline_date as date_ending'
,
'cost_model'
,
'music_no'
,
's_rate'
,
'l_rate'
,
'c_rate'
,
'p_rate'
,
'cost'
,
'prepaid'
])
->
get
();
foreach
(
$treaty
as
&
$item
)
{
$item
->
setAttribute
(
'model'
,
$item
->
charge_model
);
$treaty_item
=
$item
->
toArray
();
$files
=
[];
if
(
!
empty
(
$treaty_item
[
'files_new'
]))
{
$files
=
array_column
(
$treaty_item
[
'files_new'
],
'key'
);
}
foreach
(
$files
as
&
$file
)
{
$file
=
$client
->
getPreviewUrl
(
$file
);
}
if
((
time
()
>=
strtotime
(
$item
->
effective_date
))
&&
(
time
()
<=
strtotime
(
$item
->
date_ending
)))
{
//进行中
$item
->
setAttribute
(
'status'
,
1
);
}
else
{
//未生效 || 已经结束
$item
->
setAttribute
(
'status'
,
0
);
}
$item
->
setAttribute
(
'type'
,
1
);
//经纪合约
$item
->
setAttribute
(
'files'
,
$files
);
unset
(
$item
->
filesNew
);
}
//歌曲版权
$contract_table
=
Contract
::
table
();
$contract
=
Contract
::
query
()
->
with
([
'filesNew:id,key,link_id'
,
'moreSongs'
])
->
where
([
'flag'
=>
1
])
->
whereIn
(
'sc.stakeholder_id'
,
$this
->
stakeholder_ids
)
...
...
@@ -138,7 +110,7 @@ class MusicianAgreementService extends Service
unset
(
$right_item
[
'songs'
],
$right_item
[
'right'
]);
}
$agreement
=
array_merge
(
$
treaty
->
toArray
(),
$
rights
);
$agreement
=
array_merge
(
$rights
);
//排序
usort
(
$agreement
,
function
(
$a
,
$b
)
{
...
...
app/Services/V2/MusicianSongService.php
View file @
e5f55e1
...
...
@@ -25,6 +25,7 @@ class MusicianSongService extends Service
*/
public
function
releaseSong
()
{
$song_ids
=
array_filter
(
array_unique
(
SongStakeholder
::
query
()
->
identify
()
->
pluck
(
'song_id'
)
->
toArray
()));
if
(
empty
(
$song_ids
))
return
Response
::
success
();
...
...
Please
register
or
sign in
to post a comment