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
6f56931e
...
6f56931ee4fc76d4422e6c6ff5d6ce097a92b3bc
authored
2021-12-09 16:47:18 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合同文件
1 parent
def13a22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
app/Services/MusicianAgreementService.php
app/Services/MusicianAgreementService.php
View file @
6f56931
...
...
@@ -29,9 +29,7 @@ class MusicianAgreementService extends Service
$item_res
=
$item
->
toArray
();
$files
=
[];
if
(
!
empty
(
$item_res
[
'files_new'
]))
{
foreach
(
$item_res
[
'files_new'
]
as
$file_item
)
{
!
empty
(
$file_item
[
'key'
])
&&
$files
[]
=
$file_item
[
'key'
];
}
$files
=
array_column
(
$item_res
[
'files_new'
],
'key'
);
}
foreach
(
$files
as
&
$file
)
{
...
...
@@ -39,7 +37,7 @@ class MusicianAgreementService extends Service
}
$item
->
setAttribute
(
'files'
,
$files
);
unset
(
$item
->
file
);
unset
(
$item
->
file
sNew
);
}
return
Response
::
success
(
$res
);
...
...
@@ -54,17 +52,15 @@ class MusicianAgreementService extends Service
{
$client
=
new
CosHelper
();
$treaty
=
Treaty
::
query
()
->
whereIn
(
'party_b'
,
$this
->
stakeholder_ids
)
->
with
([
'file
:id,treaty_id,file_id'
,
'file.fileInfo:id,key
'
])
$treaty
=
Treaty
::
query
()
->
whereIn
(
'party_b'
,
$this
->
stakeholder_ids
)
->
with
([
'file
sNew: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
[
'file'
]))
{
if
(
$file_info
=
array_column
(
$treaty_item
[
'file'
],
'file_info'
)){
$files
=
array_column
(
$file_info
,
'key'
);
}
if
(
!
empty
(
$treaty_item
[
'files_new'
]))
{
$files
=
array_column
(
$treaty_item
[
'files_new'
],
'key'
);
}
foreach
(
$files
as
&
$file
)
{
...
...
@@ -81,22 +77,20 @@ class MusicianAgreementService extends Service
$item
->
setAttribute
(
'type'
,
1
);
//经纪合约
$item
->
setAttribute
(
'files'
,
$files
);
unset
(
$item
->
file
);
unset
(
$item
->
file
sNew
);
}
//歌曲版权
$contract_table
=
Contract
::
table
();
$contract
=
Contract
::
query
()
->
with
([
'files
'
,
'files.fileInfo:id,key
'
,
'moreSongs'
])
->
where
([
'flag'
=>
1
])
->
whereIn
(
'sc.stakeholder_id'
,
$this
->
stakeholder_ids
)
$contract
=
Contract
::
query
()
->
with
([
'files
New:id,key,link_id
'
,
'moreSongs'
])
->
where
([
'flag'
=>
1
])
->
whereIn
(
'sc.stakeholder_id'
,
$this
->
stakeholder_ids
)
->
join
(
StakeholderContract
::
table
()
.
" as sc"
,
Contract
::
table
()
.
".id"
,
'='
,
'sc.contract_id'
)
->
select
([
"
{
$contract_table
}
.id"
,
'contract_no'
,
'name'
,
'right_type'
,
'proportion'
,
'date_signing'
,
'date_starting'
,
'date_ending'
,
'cooperation_type'
,
'prepaid_money'
,
'reward_money'
])
->
get
()
->
toArray
();
$rights
=
[];
foreach
(
$contract
as
$contract_item
)
{
$files
=
[];
if
(
!
empty
(
$contract_item
[
'files'
]))
{
if
(
$file_info
=
array_column
(
$contract_item
[
'files'
],
'file_info'
)){
$files
=
array_column
(
$file_info
,
'key'
);
}
if
(
!
empty
(
$contract_item
[
'files_new'
]))
{
$files
=
array_column
(
$contract_item
[
'files_new'
],
'key'
);
}
foreach
(
$files
as
&
$file
)
{
...
...
Please
register
or
sign in
to post a comment