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
15f17ca1
...
15f17ca154fd3c830b1253cdc4d1c9b4fcdf7c90
authored
2021-11-15 16:05:08 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分离钱包和提现
1 parent
c78919f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
27 deletions
app/Http/Controllers/Musician/MusicianWalletController.php
app/Services/MusicianWalletService.php
app/Services/MusicianWithdrawService.php
app/Http/Controllers/Musician/MusicianWalletController.php
View file @
15f17ca
...
...
@@ -8,6 +8,7 @@ use App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest;
use
App\Http\Requests\Musician\MusicianWithdrawReceiptRequest
;
use
App\Http\Requests\Musician\MusicianWithdrawRequest
;
use
App\Http\Requests\Musician\MusicianWithdrawStatusRequest
;
use
App\Services\MusicianWalletService
;
use
App\Services\MusicianWithdrawService
;
/**
...
...
@@ -19,15 +20,15 @@ class MusicianWalletController extends Controller
/**
* @var MusicianWithdrawService
*/
protected
$musicianW
ithdraw
Service
;
protected
$musicianW
allet
Service
;
/**
* MusicianW
ithdraw
Controller constructor.
* @param MusicianW
ithdrawService $musicianWithdraw
Service
* MusicianW
allet
Controller constructor.
* @param MusicianW
alletService $musicianWallet
Service
*/
public
function
__construct
(
MusicianW
ithdrawService
$musicianWithdraw
Service
)
public
function
__construct
(
MusicianW
alletService
$musicianWallet
Service
)
{
$this
->
musicianW
ithdrawService
=
$musicianWithdraw
Service
;
$this
->
musicianW
alletService
=
$musicianWallet
Service
;
}
/**
...
...
@@ -36,7 +37,7 @@ class MusicianWalletController extends Controller
*/
public
function
walletDetail
(
MusicianWalletDetailRequest
$request
)
{
return
$this
->
musicianW
ithdraw
Service
->
walletDetail
();
return
$this
->
musicianW
allet
Service
->
walletDetail
();
}
}
...
...
app/Services/MusicianWalletService.php
0 → 100644
View file @
15f17ca
<?php
namespace
App\Services
;
use
App\Helper\CacheKeyTools
;
use
App\Helper\ErrorCode
;
use
App\Helper\RedisClient
;
use
App\Helper\Response
;
use
App\Models\Legal\Company
;
use
App\Models\Legal\Contract
;
use
App\Models\Legal\StakeholderBalanceByPayer
;
use
App\Models\Legal\StakeholderBalanceDetail
;
use
App\Models\Legal\StakeholderIncomeSyncApp
;
use
App\Models\Legal\StakeholderIncomeSyncAppDetails
;
use
App\Models\Legal\StakeholderPrepaid
;
use
App\Models\Legal\StakeholderSongCollate
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
/**
* Class MusicianWalletService
* @package App\Services
*/
class
MusicianWalletService
extends
Service
{
/**
* 返回账单详情
* @return \Illuminate\Http\JsonResponse
*/
public
function
walletDetail
()
{
$app
=
StakeholderIncomeSyncApp
::
query
()
->
where
([
'serial_no'
=>
$this
->
request
->
input
(
'serial_no'
),
'sync_status'
=>
1
])
->
first
();
if
(
empty
(
$app
))
return
Response
::
error
(
ErrorCode
::
ORDER_NO_FOUND
);
$collate
=
StakeholderSongCollate
::
query
()
->
where
([
'bills_id'
=>
$app
->
related_id
,
'stakeholder_id'
=>
$app
->
stakeholder_id
,
'subject_no'
=>
$app
->
subject_no
])
->
select
([
'song_id'
,
'role'
,
'cost_amount'
,
'deduct_prepaid as deduct_amount'
,
'real_share_amount'
,
'name'
,
'singer'
])
->
paginate
(
$this
->
pageSize
);
foreach
(
$collate
as
&
$item
)
{
$item
->
setAttribute
(
'role'
,
Contract
::
transformRole
(
$item
->
role
));
}
return
Response
::
success
(
$collate
);
}
}
app/Services/MusicianWithdrawService.php
View file @
15f17ca
...
...
@@ -24,27 +24,6 @@ use Illuminate\Support\Facades\Log;
class
MusicianWithdrawService
extends
Service
{
/**
* 返回账单详情
* @return \Illuminate\Http\JsonResponse
*/
public
function
walletDetail
()
{
$app
=
StakeholderIncomeSyncApp
::
query
()
->
where
([
'serial_no'
=>
$this
->
request
->
input
(
'serial_no'
),
'sync_status'
=>
1
])
->
first
();
if
(
empty
(
$app
))
return
Response
::
error
(
ErrorCode
::
ORDER_NO_FOUND
);
$collate
=
StakeholderSongCollate
::
query
()
->
where
([
'bills_id'
=>
$app
->
related_id
,
'stakeholder_id'
=>
$app
->
stakeholder_id
,
'subject_no'
=>
$app
->
subject_no
])
->
select
([
'song_id'
,
'role'
,
'cost_amount'
,
'deduct_prepaid as deduct_amount'
,
'real_share_amount'
,
'name'
,
'singer'
])
->
paginate
(
$this
->
pageSize
);
foreach
(
$collate
as
&
$item
)
{
$item
->
setAttribute
(
'role'
,
Contract
::
transformRole
(
$item
->
role
));
}
return
Response
::
success
(
$collate
);
}
/**
* 发票信息 - 通过名字
* @return \Illuminate\Http\JsonResponse|mixed
*/
...
...
Please
register
or
sign in
to post a comment