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
85e739e2
...
85e739e2c1f1da9a29d1a252fb176d8deca5c83f
authored
2021-06-28 20:43:12 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
4e61ce96
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
115 additions
and
32 deletions
app/Http/Controllers/Musician/MusicianAgreementController.php
app/Http/Controllers/Musician/MusicianBalanceController.php
app/Http/Controllers/Musician/MusicianIncomeController.php
app/Http/Controllers/Musician/MusicianSongController.php
app/Http/Controllers/Musician/MusicianTestController.php
app/Http/Controllers/Musician/MusicianTreatyController.php
app/Http/Controllers/Musician/MusicianWithdrawController.php
app/Models/BaseModel.php
app/Models/Legal/SongStakeholder.php
app/Providers/DataBaseQueryServiceProvider.php
app/Services/MusicianAgreementService.php
app/Services/MusicianSongService.php
config/app.php
config/logging.php
routes/api.php
app/Http/Controllers/Musician/MusicianAgreementController.php
View file @
85e739e
...
...
@@ -4,8 +4,11 @@ namespace App\Http\Controllers\Musician;
use
App\Http\Controllers\Controller
;
use
App\Services\MusicianAgreementService
;
use
Illuminate\Http\Request
;
/**
* Class MusicianAgreementController
* @package App\Http\Controllers\Musician
*/
class
MusicianAgreementController
extends
Controller
{
/**
...
...
@@ -23,7 +26,10 @@ class MusicianAgreementController extends Controller
$this
->
musicianAgreementService
=
$musicianAgreementService
;
}
/**
* 我的合约列表
* @return \Illuminate\Http\JsonResponse
*/
public
function
list
()
{
return
$this
->
musicianAgreementService
->
agreementList
();
...
...
app/Http/Controllers/Musician/MusicianBalanceController.php
View file @
85e739e
...
...
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Musician;
use
App\Http\Controllers\Controller
;
use
App\Services\MusicianBalanceService
;
use
Illuminate\Http\Request
;
class
MusicianBalanceController
extends
Controller
{
...
...
@@ -24,7 +23,7 @@ class MusicianBalanceController extends Controller
/**
* 账户详情
* @return
mixed
* @return
\Illuminate\Http\JsonResponse
*/
public
function
account
()
{
...
...
@@ -33,7 +32,7 @@ class MusicianBalanceController extends Controller
/**
* 提现详情
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
accountDetail
()
{
...
...
app/Http/Controllers/Musician/MusicianIncomeController.php
View file @
85e739e
...
...
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Musician;
use
App\Http\Controllers\Controller
;
use
App\Services\MusicianIncomeService
;
use
Illuminate\Http\Request
;
class
MusicianIncomeController
extends
Controller
{
...
...
@@ -24,7 +23,7 @@ class MusicianIncomeController extends Controller
/**
* 入账收益图表
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
income
()
{
...
...
@@ -33,7 +32,7 @@ class MusicianIncomeController extends Controller
/**
* 入账明细
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
billCollate
()
{
...
...
@@ -42,7 +41,7 @@ class MusicianIncomeController extends Controller
/**
* 入账明细详情
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
billCollateDetail
()
{
...
...
app/Http/Controllers/Musician/MusicianSongController.php
View file @
85e739e
...
...
@@ -24,7 +24,7 @@ class MusicianSongController extends Controller
/**
* 授权歌曲列表
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
list
()
{
...
...
@@ -33,7 +33,8 @@ class MusicianSongController extends Controller
/**
* 发行歌曲详情
* @return \Psr\Http\Message\ResponseInterface
* @param $song_id
* @return \Illuminate\Http\JsonResponse
*/
public
function
detail
(
$song_id
)
{
...
...
@@ -43,7 +44,7 @@ class MusicianSongController extends Controller
/**
* 歌曲权益
* @param $song_id
* @return
mixed
* @return
\Illuminate\Http\JsonResponse
*/
public
function
right
(
$song_id
)
{
...
...
app/Http/Controllers/Musician/MusicianTestController.php
deleted
100644 → 0
View file @
4e61ce9
<?php
namespace
App\Http\Controllers\Musician
;
use
App\Http\Controllers\Controller
;
class
MusicianTestController
extends
Controller
{
public
function
test
()
{
var_dump
(
__METHOD__
);
}
}
app/Http/Controllers/Musician/MusicianTreatyController.php
View file @
85e739e
...
...
@@ -24,7 +24,7 @@ class MusicianTreatyController extends Controller
/**
* 经纪合约
* @return \
Psr\Http\Message\ResponseInterfac
e
* @return \
Illuminate\Http\JsonRespons
e
*/
public
function
list
()
{
...
...
app/Http/Controllers/Musician/MusicianWithdrawController.php
View file @
85e739e
...
...
@@ -21,6 +21,10 @@ class MusicianWithdrawController extends Controller
$this
->
musicianWithdrawService
=
$musicianWithdrawService
;
}
/**
* 冻结资金
* @return \Illuminate\Http\JsonResponse
*/
public
function
prepare
()
{
return
$this
->
musicianWithdrawService
->
prepare
();
...
...
app/Models/BaseModel.php
View file @
85e739e
...
...
@@ -58,8 +58,7 @@ class BaseModel extends Model
*/
public
function
scopeIdentify
(
Builder
$builder
)
{
$builder
=
$builder
->
whereIn
(
'stakeholder_id'
,
request
()
->
get
(
'identifier'
)
->
identifier
);
return
$builder
;
return
$builder
->
whereIn
(
'stakeholder_id'
,
[
request
()
->
get
(
'identifier'
)
->
identifier
]);
}
}
...
...
app/Models/Legal/SongStakeholder.php
View file @
85e739e
...
...
@@ -13,6 +13,8 @@ class SongStakeholder extends BaseModel
{
use
HasFactory
;
protected
$table
=
'song_stakeholder'
;
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
...
...
app/Providers/DataBaseQueryServiceProvider.php
0 → 100644
View file @
85e739e
<?php
namespace
App\Providers
;
use
Carbon\Carbon
;
use
Illuminate\Database\Events\TransactionBeginning
;
use
Illuminate\Database\Events\TransactionCommitted
;
use
Illuminate\Database\Events\TransactionRolledBack
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Event
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\ServiceProvider
;
class
DataBaseQueryServiceProvider
extends
ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public
function
register
()
{
if
(
config
(
'logging.sql.enable'
)
===
false
)
{
return
;
}
DB
::
listen
(
function
(
$query
)
:
void
{
$sql
=
$query
->
sql
;
foreach
(
$query
->
bindings
as
$binding
)
{
if
(
is_string
(
$binding
))
{
$binding
=
"'
{
$binding
}
'"
;
}
elseif
(
is_bool
(
$binding
))
{
$binding
=
$binding
?
'1'
:
'0'
;
}
elseif
(
is_int
(
$binding
))
{
$binding
=
(
string
)
$binding
;
}
elseif
(
$binding
===
null
)
{
$binding
=
'NULL'
;
}
elseif
(
$binding
instanceof
Carbon
)
{
$binding
=
"'
{
$binding
->
toDateTimeString
()
}
'"
;
}
elseif
(
$binding
instanceof
\DateTime
)
{
$binding
=
"'
{
$binding
->
format
(
'Y-m-d H:i:s'
)
}
'"
;
}
$sql
=
preg_replace
(
'/\\?/'
,
$binding
,
$sql
,
1
);
}
Log
::
channel
(
'sql'
)
->
debug
(
'SQL'
,
[
'sql'
=>
$sql
,
'time'
=>
"
{
$query
->
time
}
ms"
]);
});
Event
::
listen
(
TransactionBeginning
::
class
,
function
(
TransactionBeginning
$event
)
:
void
{
Log
::
channel
(
'sql'
)
->
debug
(
'START TRANSACTION'
);
});
Event
::
listen
(
TransactionCommitted
::
class
,
function
(
TransactionCommitted
$event
)
:
void
{
Log
::
channel
(
'sql'
)
->
debug
(
'COMMIT'
);
});
Event
::
listen
(
TransactionRolledBack
::
class
,
function
(
TransactionRolledBack
$event
)
:
void
{
Log
::
channel
(
'sql'
)
->
debug
(
'ROLLBACK'
);
});
}
/**
* Bootstrap services.
*
* @return void
*/
public
function
boot
()
{
//
}
}
app/Services/MusicianAgreementService.php
View file @
85e739e
...
...
@@ -34,7 +34,7 @@ class MusicianAgreementService extends Service
return
Response
::
success
(
$res
);
}
/*
/**
* 我的合约列表
* @return \Psr\Http\Message\ResponseInterface
...
...
app/Services/MusicianSongService.php
View file @
85e739e
...
...
@@ -23,7 +23,11 @@ class MusicianSongService extends Service
*/
public
function
releaseSong
()
{
$song_ids
=
array_unique
(
SongStakeholder
::
query
()
->
identify
()
->
pluck
(
'song_id'
)
->
toArray
());
if
(
empty
(
$song_ids
))
return
Response
::
success
();
$song_table
=
Song
::
table
();
$songip_table
=
SongsIp
::
table
();
...
...
config/app.php
View file @
85e739e
...
...
@@ -175,6 +175,8 @@ return [
App\Providers\EventServiceProvider
::
class
,
App\Providers\RouteServiceProvider
::
class
,
\App\Providers\DataBaseQueryServiceProvider
::
class
,
],
/*
...
...
config/logging.php
View file @
85e739e
...
...
@@ -17,7 +17,7 @@ return [
|
*/
'default'
=>
env
(
'LOG_CHANNEL'
,
'
stack
'
),
'default'
=>
env
(
'LOG_CHANNEL'
,
'
daily
'
),
/*
|--------------------------------------------------------------------------
...
...
@@ -100,6 +100,14 @@ return [
'emergency'
=>
[
'path'
=>
storage_path
(
'logs/laravel.log'
),
],
'sql'
=>
[
'enable'
=>
env
(
'LOG_SQL_ENABLE'
,
false
),
'driver'
=>
'daily'
,
'path'
=>
storage_path
(
'logs/laravel-sql.log'
),
'level'
=>
env
(
'LOG_LEVEL'
,
'debug'
),
'days'
=>
14
,
],
],
];
...
...
routes/api.php
View file @
85e739e
...
...
@@ -17,7 +17,7 @@ use App\Http\Controllers\Api;
Route
::
group
([],
function
(){
//首页-音乐人
Route
::
get
(
'musician_song'
,
'Musician
Withdraw
Controller@list'
);
Route
::
get
(
'musician_song'
,
'Musician
Song
Controller@list'
);
Route
::
get
(
'musician_song/{song_id}'
,
'MusicianSongController@detail'
);
Route
::
get
(
'musician_song/{song_id}/right'
,
'MusicianSongController@right'
);
//经纪约列表
...
...
@@ -37,7 +37,6 @@ Route::group([], function (){
//提现请求
Route
::
post
(
'musician/withdraw_prepare'
,
'App\Controller\Musician\MusicianWithdrawController@prepare'
);
Route
::
get
(
'musician/test'
,
'MusicianTestController@test'
);
});
...
...
Please
register
or
sign in
to post a comment