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
bae4729c
...
bae4729cb4fc20cdad5858c0f2460f829f05d584
authored
2022-11-29 13:53:36 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
歌曲文件
1 parent
27ad2971
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
app/Models/Legal/PropertyTrack.php
app/Services/PropertyTrackService.php
app/Models/Legal/PropertyTrack.php
View file @
bae4729
...
...
@@ -9,6 +9,10 @@ class PropertyTrack extends BaseModel
{
use
SoftDeletes
;
public
$hidden
=
[
'deleted_at'
,
'updated_at'
,
'apply_id'
,
'song_id'
,
'project_id'
,
'company_id'
];
public
$guarded
=
[];
/**
...
...
app/Services/PropertyTrackService.php
View file @
bae4729
...
...
@@ -5,8 +5,11 @@ namespace App\Services;
use
App\Helper\CosHelper
;
use
App\Helper\Response
;
use
App\Models\Legal\Contract
;
use
App\Models\Legal\PropertyTrack
;
use
App\Models\Legal\StakeholderContract
;
use
App\Models\Legal\Treaty
;
use
App\Models\Musician\AppCompanyUser
;
use
Illuminate\Database\Eloquent\Builder
;
use
Qcloud\Cos\Client
;
/**
...
...
@@ -21,9 +24,16 @@ class PropertyTrackService extends Service
*/
public
function
list
()
{
$res
=
PropertyTrack
::
query
()
->
where
([
'create_admin'
=>
$this
->
identifier
->
company_id
,
'from'
=>
1
])
->
when
(
filled
(
$this
->
request
->
input
(
'upload_time'
)),
function
(
Builder
$builder
){
list
(
$start
,
$end
)
=
explode
(
'-'
,
$this
->
request
->
input
(
'upload_time'
));
$builder
->
whereBetween
(
'upload_time'
,
[
trim
(
$start
),
trim
(
$end
)]);
})
->
when
(
filled
(
$this
->
request
->
input
(
'song_name'
)),
function
(
Builder
$builder
){
$builder
->
where
(
'like'
,
'like'
,
"%
{
$this
->
request
->
input
(
'song_name'
)
}
%"
);
})
->
orderByDesc
(
'id'
)
->
paginate
(
$this
->
pageSize
);
return
Response
::
success
();
return
Response
::
success
(
$res
);
}
/**
...
...
@@ -32,24 +42,35 @@ class PropertyTrackService extends Service
*/
public
function
show
()
{
$data
=
[];
if
(
$track
=
PropertyTrack
::
query
()
->
where
([
'id'
=>
$this
->
request
->
input
(
'track_id'
),
'from'
=>
1
])
->
first
())
{
$user
=
AppCompanyUser
::
query
()
->
where
([
'id'
=>
$track
->
create_admin
])
->
first
();
$track
->
setAttribute
(
'submit_name'
,
$user
?
$user
->
name
:
''
);
return
Response
::
success
();
}
return
Response
::
success
(
$data
);
}
/**
* 待上传数据
* @return \Illuminate\Http\JsonResponse
*/
public
function
pending
()
{
return
Response
::
success
();
$count
=
PropertyTrack
::
query
()
->
where
([
'create_admin'
=>
$this
->
identifier
->
company_id
])
->
whereNull
(
'upload_time'
)
->
count
();
return
Response
::
success
([
'count'
=>
$count
]);
}
/**
* 歌曲上传文件列表
* 歌曲上传文件列表
(不登录)
* @return \Illuminate\Http\JsonResponse
*/
public
function
file
()
{
return
Response
::
success
();
}
}
...
...
Please
register
or
sign in
to post a comment