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
d43bc50f
...
d43bc50f2706b4d26c6bc7dccf88e88986a350c3
authored
2021-08-23 16:33:14 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
1a66fa84
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
10 deletions
app/Helper/ErrorCode.php
app/Http/Controllers/Musician/MusicianWithdrawController.php
app/Models/Legal/StakeholderIncomeByPayer.php
app/Services/MusicianWithdrawService.php
composer.json
routes/api.php
app/Helper/ErrorCode.php
View file @
d43bc50
...
...
@@ -16,8 +16,9 @@ class ErrorCode
const
ORDER_ILLEGAl
=
40040
;
const
ORDER_WITHDRAW_ERROR
=
40041
;
const
ORDER_MONEY_ERROR
=
40042
;
const
WITHDRAW_PREPARE_ERROR
=
40050
;
const
WITHDRAW_HANDLE_ERROR
=
40051
;
const
WITHDRAW_NO_RECORD
=
40051
;
const
WITHDRAW_HANDLE_ERROR
=
40052
;
/**
* @var string[]
...
...
@@ -32,7 +33,7 @@ class ErrorCode
self
::
ORDER_ILLEGAl
=>
'提现订单有误'
,
self
::
ORDER_WITHDRAW_ERROR
=>
'提现记录有误'
,
self
::
ORDER_MONEY_ERROR
=>
'提现金额有误'
,
self
::
WITHDRAW_
PREPARE_ERROR
=>
'提现申请失败
'
,
self
::
WITHDRAW_
NO_RECORD
=>
'未匹配有效提现记录
'
,
self
::
WITHDRAW_HANDLE_ERROR
=>
'提现操作失败'
,
];
...
...
app/Http/Controllers/Musician/MusicianWithdrawController.php
View file @
d43bc50
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers\Musician
;
use
App\Http\Controllers\Controller
;
use
App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest
;
use
App\Http\Requests\Musician\MusicianWithdrawReceiptRequest
;
use
App\Http\Requests\Musician\MusicianWithdrawRequest
;
use
App\Http\Requests\Musician\MusicianWithdrawStatusRequest
;
...
...
@@ -30,6 +31,7 @@ class MusicianWithdrawController extends Controller
/**
* 发票信息
* @param MusicianWithdrawReceiptRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public
function
receipt
(
MusicianWithdrawReceiptRequest
$request
)
...
...
@@ -38,6 +40,17 @@ class MusicianWithdrawController extends Controller
}
/**
* 通过公司名称查询发票信息
* @param MusicianWithdrawReceiptByNameRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public
function
receiptByName
(
MusicianWithdrawReceiptByNameRequest
$request
)
{
return
$this
->
musicianWithdrawService
->
receiptInfoByName
();
}
/**
* 提现修改状态
* @return \Illuminate\Http\JsonResponse
*/
...
...
app/Models/Legal/StakeholderIncomeByPayer.php
View file @
d43bc50
...
...
@@ -4,7 +4,6 @@ namespace App\Models\Legal;
use
App\Models\BaseModel
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
/**
* 进账收益流水
...
...
app/Services/MusicianWithdrawService.php
View file @
d43bc50
...
...
@@ -2,7 +2,9 @@
namespace
App\Services
;
use
App\Helper\ErrorCode
;
use
App\Helper\Response
;
use
App\Models\Legal\Company
;
use
App\Models\Legal\StakeholderIncomeByPayer
;
/**
...
...
@@ -12,7 +14,34 @@ use App\Models\Legal\StakeholderIncomeByPayer;
class
MusicianWithdrawService
extends
Service
{
/**
* 发票信息
* 发票信息 - 通过名字
* @return \Illuminate\Http\JsonResponse|mixed
*/
public
function
receiptInfoByName
()
{
if
(
!
StakeholderIncomeByPayer
::
query
()
->
where
([
'sync_status'
=>
1
,
'withdraw_status'
=>
0
,
'identifier'
=>
$this
->
identifier
->
identifier
])
->
count
())
{
return
Response
::
error
(
ErrorCode
::
WITHDRAW_NO_RECORD
);
}
if
(
$receipt
=
Company
::
query
()
->
where
([
'receipt_name'
=>
$this
->
request
->
input
(
'name'
)])
->
first
())
{
return
Response
::
success
([
'receipt_type'
=>
$receipt
->
company
->
receipt_type
,
'receipt_name'
=>
$receipt
->
company
->
receipt_name
,
'receipt_no'
=>
$receipt
->
company
->
receipt_no
,
'receipt_tel'
=>
$receipt
->
company
->
receipt_tel
,
'receipt_address'
=>
$receipt
->
company
->
receipt_address
,
'receipt_bank'
=>
$receipt
->
company
->
receipt_bank
,
'receipt_bank_no'
=>
$receipt
->
company
->
receipt_bank_no
,
]);
}
else
{
return
Response
::
success
();
}
}
/**
* 发票信息 - 通过流水号
* @return \Illuminate\Http\JsonResponse
*/
public
function
receiptInfo
()
...
...
@@ -22,10 +51,8 @@ class MusicianWithdrawService extends Service
StakeholderIncomeByPayer
::
query
()
->
with
(
'company:company_id,receipt_type,receipt_name,receipt_no,receipt_tel,receipt_address,receipt_bank,receipt_bank_no'
)
->
where
([
'identifier'
=>
$this
->
identifier
->
identifier
,
'sync_status'
=>
1
])
->
whereIn
(
'serial_no'
,
$this
->
request
->
input
(
'serial_no'
))
->
select
([
'id'
,
'company_id'
,
'serial_no'
,
'busi_id'
])
->
get
()
->
map
(
function
(
$item
)
use
(
&
$receipt
)
{
if
(
!
empty
(
$item
->
company
))
{
$receipt
[]
=
[
'serial_no'
=>
$item
->
serial_no
,
'busi_id'
=>
$item
->
busi_id
,
if
(
!
empty
(
$item
->
company
->
company_id
))
{
$receipt
[
$item
->
company
->
company_id
]
=
[
'receipt_type'
=>
$item
->
company
->
receipt_type
,
'receipt_name'
=>
$item
->
company
->
receipt_name
,
'receipt_no'
=>
$item
->
company
->
receipt_no
,
...
...
composer.json
View file @
d43bc50
...
...
@@ -11,7 +11,8 @@
"guzzlehttp/guzzle"
:
"^7.0.1"
,
"laravel/framework"
:
"^8.40"
,
"laravel/tinker"
:
"^2.5"
,
"phpseclib/phpseclib"
:
"~3.0"
"phpseclib/phpseclib"
:
"~3.0"
,
"ext-json"
:
"*"
},
"require-dev"
:
{
"facade/ignition"
:
"^2.5"
,
...
...
routes/api.php
View file @
d43bc50
...
...
@@ -37,6 +37,9 @@ Route::group([], function (){
//提现发票抬头
Route
::
post
(
'withdraw/receipt'
,
'MusicianWithdrawController@receipt'
);
//提现发票抬头 - 通过公司中文
Route
::
post
(
'withdraw/receipt_by_name'
,
'MusicianWithdrawController@receiptByName'
);
//账单状态修改
Route
::
post
(
'withdraw/status'
,
'MusicianWithdrawController@status'
);
...
...
Please
register
or
sign in
to post a comment