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
def13a22
...
def13a2290adecb8e660cf59bf14395f6986f9c0
authored
2021-12-09 16:38:43 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合同文件
1 parent
6d771020
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
app/Models/Legal/Treaty.php
app/Services/MusicianAgreementService.php
app/Models/Legal/Treaty.php
View file @
def13a2
...
...
@@ -22,9 +22,9 @@ class Treaty extends BaseModel
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public
function
file
()
public
function
file
sNew
()
{
return
$this
->
hasMany
(
TreatyFile
::
class
,
'treaty_id
'
);
return
$this
->
hasMany
(
FileMap
::
class
,
'link_id'
,
'id'
)
->
where
(
'link'
,
'treaty
'
);
}
/**
...
...
app/Services/MusicianAgreementService.php
View file @
def13a2
...
...
@@ -20,7 +20,7 @@ class MusicianAgreementService extends Service
*/
public
function
treatyList
()
{
$res
=
Treaty
::
query
()
->
whereIn
(
'party_b'
,
$this
->
stakeholder_ids
)
->
where
(
'deadline_date'
,
'>'
,
$this
->
now
)
->
with
([
'file
:id,treaty_id,file_id'
,
'file.fileInfo:id,key
'
])
$res
=
Treaty
::
query
()
->
whereIn
(
'party_b'
,
$this
->
stakeholder_ids
)
->
where
(
'deadline_date'
,
'>'
,
$this
->
now
)
->
with
([
'file
sNew:id,key,link_id
'
])
->
select
([
'id'
,
'treaty_name'
,
'treaty_type'
,
'service_type'
,
'deadline_date'
,
'music_no'
])
->
orderByDesc
(
'created_at'
)
->
paginate
(
$this
->
pageSize
);
$client
=
new
CosHelper
();
...
...
@@ -28,9 +28,9 @@ class MusicianAgreementService extends Service
foreach
(
$res
as
&
$item
)
{
$item_res
=
$item
->
toArray
();
$files
=
[];
if
(
!
empty
(
$item_res
[
'file'
]))
{
foreach
(
$item_res
[
'file'
]
as
$file_item
)
{
!
empty
(
$file_item
[
'
file_info'
][
'key'
])
&&
$files
[]
=
$file_item
[
'file_info'
]
[
'key'
];
if
(
!
empty
(
$item_res
[
'file
s_new
'
]))
{
foreach
(
$item_res
[
'file
s_new
'
]
as
$file_item
)
{
!
empty
(
$file_item
[
'
key'
])
&&
$files
[]
=
$file_item
[
'key'
];
}
}
...
...
Please
register
or
sign in
to post a comment