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
6d771020
...
6d771020c30497af947f203785d0fcfb3278c018
authored
2021-12-09 16:16:54 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合同文件
1 parent
8485c7b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
app/Models/Legal/Contract.php
app/Services/MusicianSongService.php
app/Models/Legal/Contract.php
View file @
6d77102
...
...
@@ -274,6 +274,15 @@ class Contract extends BaseModel
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public
function
filesNew
()
{
return
$this
->
hasMany
(
FileMap
::
class
,
'link_id'
,
'id'
)
->
where
(
'link'
,
'contract'
);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public
function
moreSongs
()
...
...
app/Services/MusicianSongService.php
View file @
6d77102
...
...
@@ -205,7 +205,7 @@ class MusicianSongService extends Service
$client
=
new
CosHelper
();
$res
=
SongStakeholder
::
query
()
->
where
(
'song_id'
,
$song_id
)
->
identify
()
->
with
([
'contract:id,cooperation_type,date_starting,date_ending,district_id,is_exclusive'
,
'contract.stakeholderContract'
,
'contract.files
'
,
'contract.files.fileInfo:id,key
'
])
->
with
([
'contract:id,cooperation_type,date_starting,date_ending,district_id,is_exclusive'
,
'contract.stakeholderContract'
,
'contract.files
New:id,key,link_id
'
])
->
get
()
->
toArray
();
$contracts
=
[];
...
...
@@ -216,10 +216,8 @@ class MusicianSongService extends Service
$files
=
[];
if
(
!
empty
(
$item
[
'contract'
][
'files'
]))
{
if
(
$file_info
=
array_column
(
$item
[
'contract'
][
'files'
],
'file_info'
)){
$files
=
array_column
(
$file_info
,
'key'
);
}
if
(
!
empty
(
$item
[
'contract'
][
'files_new'
]))
{
$files
=
array_column
(
$item
[
'contract'
][
'files_new'
],
'key'
);
}
foreach
(
$files
as
&
$file
)
{
...
...
Please
register
or
sign in
to post a comment