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
e244a64c
...
e244a64c41e8cfb18dfebb750aaf0c12d10dfc5f
authored
2022-12-15 13:40:29 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
50184906
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
app/Models/Legal/PropertyTrackFile.php
app/Services/PropertyTrackService.php
app/Models/Legal/PropertyTrackFile.php
View file @
e244a64
...
...
@@ -11,7 +11,7 @@ class PropertyTrackFile extends BaseModel
protected
$guarded
=
[];
public
$hidden
=
[
'deleted_at'
,
'updated_at'
,
'
from'
,
'
id'
,
'pt_id'
,
'file_id'
,
'deleted_at'
,
'updated_at'
,
'id'
,
'pt_id'
,
'file_id'
,
];
/**
...
...
app/Services/PropertyTrackService.php
View file @
e244a64
...
...
@@ -92,6 +92,23 @@ class PropertyTrackService extends Service
$trackFiles
=
PropertyTrackFile
::
query
()
->
with
(
'ptfTypes.type:id,type_name,remark'
)
->
where
([
'pt_id'
=>
$this
->
request
->
input
(
'track_id'
)])
->
orderByDesc
(
'id'
)
->
paginate
(
$this
->
pageSize
);
$user_ids
=
[];
foreach
(
$trackFiles
as
$item
)
{
if
(
$item
[
'from'
]
==
1
)
{
$user_ids
[]
=
$item
->
upload_user
;
}
}
if
(
$user_ids
)
{
$user_ids
=
AppCompanyUser
::
query
()
->
whereIn
(
'id'
,
array_unique
(
$user_ids
))
->
pluck
(
'name'
,
'id'
)
->
toArray
();
}
foreach
(
$trackFiles
as
&
$item
)
{
if
(
$item
[
'from'
]
==
1
)
{
$item
->
upload_user
=
$user_ids
[
$item
->
upload_user
]
??
''
;
}
}
return
Response
::
success
(
$trackFiles
);
}
...
...
@@ -218,9 +235,15 @@ class PropertyTrackService extends Service
$data
=
[];
//详情
if
(
$track
=
PropertyTrack
::
query
()
->
with
(
'project:id,name'
)
->
where
([
'id'
=>
$this
->
request
->
get
(
'track_id'
),
'from'
=>
1
])
->
first
())
{
$user
=
AppCompany
::
query
()
->
where
([
'company_id'
=>
$track
->
create_admin
])
->
first
();
$track
->
setAttribute
(
'submit_name'
,
$user
?
$user
->
company_name
:
''
);
if
(
$track
=
PropertyTrack
::
query
()
->
with
(
'project:id,name'
)
->
where
([
'id'
=>
$this
->
request
->
get
(
'track_id'
)])
->
first
())
{
if
(
$track
->
from
)
{
$record
=
AppCompany
::
query
()
->
where
([
'company_id'
=>
$track
->
last_admin
])
->
select
([
'company_name as name'
])
->
first
();
}
else
{
$record
=
User
::
query
()
->
where
([
'user_id'
=>
$track
->
last_admin
])
->
select
([
'name'
])
->
first
();
}
$track
->
setAttribute
(
'submit_name'
,
$record
?
$record
->
name
:
''
);
$data
=
$track
;
}
...
...
Please
register
or
sign in
to post a comment