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
eea64568
...
eea645688d11e97514650023351959cddc567063
authored
2021-06-29 11:58:00 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
3cdde2db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
app/Http/Controllers/Musician/MusicianAgreementController.php
app/Services/MusicianAgreementService.php
app/Services/MusicianIncomeService.php
app/Http/Controllers/Musician/MusicianAgreementController.php
View file @
eea6456
...
...
@@ -22,7 +22,6 @@ class MusicianAgreementController extends Controller
*/
public
function
__construct
(
MusicianAgreementService
$musicianAgreementService
)
{
var_dump
(
__METHOD__
);
$this
->
musicianAgreementService
=
$musicianAgreementService
;
}
...
...
app/Services/MusicianAgreementService.php
View file @
eea6456
...
...
@@ -37,7 +37,7 @@ class MusicianAgreementService extends Service
/**
* 我的合约列表
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
agreementList
()
{
...
...
app/Services/MusicianIncomeService.php
View file @
eea6456
...
...
@@ -21,7 +21,7 @@ class MusicianIncomeService extends Service
$start_month
=
$this
->
request
->
input
(
'start'
,
date
(
'Ym'
,
strtotime
(
'-6 month'
)));
$end_month
=
$this
->
request
->
input
(
'end'
,
date
(
'Ym'
,
strtotime
(
'-1 month'
)));
$res
=
StakeholderSongCollate
::
query
()
->
custom
(
$this
->
request
->
inputs
([
'song_id'
]))
->
identify
()
$res
=
StakeholderSongCollate
::
query
()
->
custom
(
$this
->
request
->
only
([
'song_id'
]))
->
identify
()
->
groupBy
(
'month'
)
->
orderBy
(
'month'
)
->
selectRaw
(
'month, sum(share_amount) as income'
)
->
get
()
->
toArray
();
$stat_income
=
[];
...
...
@@ -41,7 +41,7 @@ class MusicianIncomeService extends Service
public
function
billCollate
()
{
$collate
=
$detail
=
$contract_ids
=
[];
StakeholderSongCollate
::
query
()
->
custom
(
$this
->
request
->
inputs
([
'song_id'
]))
->
identify
()
StakeholderSongCollate
::
query
()
->
custom
(
$this
->
request
->
only
([
'song_id'
]))
->
identify
()
->
orderByDesc
(
'month'
)
->
each
(
function
(
$item
)
use
(
&
$collate
,
&
$detail
,
&
$contract_ids
){
$key
=
"
{
$item
->
month
}
|
{
$item
->
channel
}
"
;
if
(
!
isset
(
$detail
[
$key
]))
{
...
...
@@ -91,7 +91,7 @@ class MusicianIncomeService extends Service
{
$cooperation_types
=
$detail
=
[];
StakeholderSongCollate
::
query
()
->
with
([
'song:id,name,singer'
,
'contract:id,cooperation_type'
])
->
custom
(
$this
->
request
->
inputs
([
'month'
,
'channel'
]))
->
identify
()
StakeholderSongCollate
::
query
()
->
with
([
'song:id,name,singer'
,
'contract:id,cooperation_type'
])
->
custom
(
$this
->
request
->
only
([
'month'
,
'channel'
]))
->
identify
()
->
select
([
'id'
,
'song_id'
,
'month'
,
'contract_id'
,
'deduct_amount'
,
'real_share_amount'
])
->
each
(
function
(
$item
)
use
(
&
$cooperation_types
,
&
$detail
){
...
...
Please
register
or
sign in
to post a comment