*
Showing
9 changed files
with
16 additions
and
14 deletions
... | @@ -10,4 +10,5 @@ use Illuminate\Routing\Controller as BaseController; | ... | @@ -10,4 +10,5 @@ use Illuminate\Routing\Controller as BaseController; |
10 | class Controller extends BaseController | 10 | class Controller extends BaseController |
11 | { | 11 | { |
12 | use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | 12 | use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
13 | |||
13 | } | 14 | } | ... | ... |
... | @@ -4,8 +4,11 @@ namespace App\Http\Controllers\Musician; | ... | @@ -4,8 +4,11 @@ namespace App\Http\Controllers\Musician; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Services\MusicianSongService; | 6 | use App\Services\MusicianSongService; |
7 | use Illuminate\Http\Request; | ||
8 | 7 | ||
8 | /** | ||
9 | * Class MusicianSongController | ||
10 | * @package App\Http\Controllers\Musician | ||
11 | */ | ||
9 | class MusicianSongController extends Controller | 12 | class MusicianSongController extends Controller |
10 | { | 13 | { |
11 | /** | 14 | /** | ... | ... |
... | @@ -2,6 +2,7 @@ | ... | @@ -2,6 +2,7 @@ |
2 | 2 | ||
3 | namespace App\Http; | 3 | namespace App\Http; |
4 | 4 | ||
5 | use App\Http\Middleware\AuthIdentifier; | ||
5 | use Illuminate\Foundation\Http\Kernel as HttpKernel; | 6 | use Illuminate\Foundation\Http\Kernel as HttpKernel; |
6 | 7 | ||
7 | class Kernel extends HttpKernel | 8 | class Kernel extends HttpKernel |
... | @@ -21,6 +22,7 @@ class Kernel extends HttpKernel | ... | @@ -21,6 +22,7 @@ class Kernel extends HttpKernel |
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, | 22 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |
22 | \App\Http\Middleware\TrimStrings::class, | 23 | \App\Http\Middleware\TrimStrings::class, |
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, | 24 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, |
25 | AuthIdentifier::class | ||
24 | ]; | 26 | ]; |
25 | 27 | ||
26 | /** | 28 | /** |
... | @@ -62,6 +64,5 @@ class Kernel extends HttpKernel | ... | @@ -62,6 +64,5 @@ class Kernel extends HttpKernel |
62 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, | 64 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, |
63 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, | 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
64 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, | 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, |
65 | 'identifier'=> \App\Http\Middleware\AuthIdentifier::class, | ||
66 | ]; | 67 | ]; |
67 | } | 68 | } | ... | ... |
... | @@ -58,7 +58,7 @@ class BaseModel extends Model | ... | @@ -58,7 +58,7 @@ class BaseModel extends Model |
58 | */ | 58 | */ |
59 | public function scopeIdentify(Builder $builder) | 59 | public function scopeIdentify(Builder $builder) |
60 | { | 60 | { |
61 | return $builder->whereIn('stakeholder_id', [request()->get('identifier')->identifier]); | 61 | return $builder->whereIn('stakeholder_id', request()->get('stakeholder_ids')); |
62 | } | 62 | } |
63 | 63 | ||
64 | } | 64 | } | ... | ... |
... | @@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider | ... | @@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider |
39 | 39 | ||
40 | $this->routes(function () { | 40 | $this->routes(function () { |
41 | Route::prefix('api') | 41 | Route::prefix('api') |
42 | ->middleware(['api', 'identifier']) | 42 | ->middleware('api') |
43 | ->namespace($this->namespace . '\Musician') | 43 | ->namespace($this->namespace . '\Musician') |
44 | ->group(base_path('routes/api.php')); | 44 | ->group(base_path('routes/api.php')); |
45 | 45 | ... | ... |
... | @@ -23,14 +23,14 @@ class MusicianSongService extends Service | ... | @@ -23,14 +23,14 @@ class MusicianSongService extends Service |
23 | */ | 23 | */ |
24 | public function releaseSong() | 24 | public function releaseSong() |
25 | { | 25 | { |
26 | 26 | $song_ids = array_filter(array_unique(SongStakeholder::query()->identify()->pluck('song_id')->toArray())); | |
27 | $song_ids = array_unique(SongStakeholder::query()->identify()->pluck('song_id')->toArray()); | ||
28 | 27 | ||
29 | if (empty($song_ids)) return Response::success(); | 28 | if (empty($song_ids)) return Response::success(); |
30 | 29 | ||
31 | $song_table = Song::table(); | 30 | $song_table = Song::table(); |
32 | $songip_table = SongsIp::table(); | 31 | $songip_table = SongsIp::table(); |
33 | 32 | ||
33 | |||
34 | $res = Song::query()->join($songip_table, "{$song_table}.id", '=', "{$songip_table}.song_id") | 34 | $res = Song::query()->join($songip_table, "{$song_table}.id", '=', "{$songip_table}.song_id") |
35 | ->with('contractDetail')->whereIn("{$songip_table}.song_id", $song_ids)->select(["{$song_table}.id", 'publish_song']) | 35 | ->with('contractDetail')->whereIn("{$songip_table}.song_id", $song_ids)->select(["{$song_table}.id", 'publish_song']) |
36 | ->groupBy(["song_id"])->paginate($this->pageSize); | 36 | ->groupBy(["song_id"])->paginate($this->pageSize); | ... | ... |
... | @@ -174,8 +174,7 @@ return [ | ... | @@ -174,8 +174,7 @@ return [ |
174 | // App\Providers\BroadcastServiceProvider::class, | 174 | // App\Providers\BroadcastServiceProvider::class, |
175 | App\Providers\EventServiceProvider::class, | 175 | App\Providers\EventServiceProvider::class, |
176 | App\Providers\RouteServiceProvider::class, | 176 | App\Providers\RouteServiceProvider::class, |
177 | 177 | App\Providers\DataBaseQueryServiceProvider::class, | |
178 | \App\Providers\DataBaseQueryServiceProvider::class, | ||
179 | 178 | ||
180 | ], | 179 | ], |
181 | 180 | ... | ... |
... | @@ -56,7 +56,7 @@ return [ | ... | @@ -56,7 +56,7 @@ return [ |
56 | 'collation' => 'utf8mb4_unicode_ci', | 56 | 'collation' => 'utf8mb4_unicode_ci', |
57 | 'prefix' => '', | 57 | 'prefix' => '', |
58 | 'prefix_indexes' => true, | 58 | 'prefix_indexes' => true, |
59 | 'strict' => true, | 59 | 'strict' => false, |
60 | 'engine' => null, | 60 | 'engine' => null, |
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ | 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ |
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), | 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), |
... | @@ -104,7 +104,7 @@ return [ | ... | @@ -104,7 +104,7 @@ return [ |
104 | 'collation' => 'utf8mb4_unicode_ci', | 104 | 'collation' => 'utf8mb4_unicode_ci', |
105 | 'prefix' => '', | 105 | 'prefix' => '', |
106 | 'prefix_indexes' => true, | 106 | 'prefix_indexes' => true, |
107 | 'strict' => true, | 107 | 'strict' => false, |
108 | 'engine' => null, | 108 | 'engine' => null, |
109 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ | 109 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ |
110 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), | 110 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), | ... | ... |
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use Illuminate\Http\Request; | ||
4 | use Illuminate\Support\Facades\Route; | 3 | use Illuminate\Support\Facades\Route; |
5 | use App\Http\Controllers\Api; | ||
6 | 4 | ||
7 | /* | 5 | /* |
8 | |-------------------------------------------------------------------------- | 6 | |-------------------------------------------------------------------------- |
... | @@ -14,10 +12,12 @@ use App\Http\Controllers\Api; | ... | @@ -14,10 +12,12 @@ use App\Http\Controllers\Api; |
14 | | is assigned the "api" middleware group. Enjoy building your API! | 12 | | is assigned the "api" middleware group. Enjoy building your API! |
15 | | | 13 | | |
16 | */ | 14 | */ |
15 | |||
17 | Route::group([], function (){ | 16 | Route::group([], function (){ |
18 | 17 | ||
19 | //首页-音乐人 | 18 | //首页-音乐人 |
20 | Route::get('musician_song', 'MusicianSongController@list'); | 19 | Route::get('musician_song', 'MusicianSongController@list'); |
20 | |||
21 | Route::get('musician_song/{song_id}', 'MusicianSongController@detail'); | 21 | Route::get('musician_song/{song_id}', 'MusicianSongController@detail'); |
22 | Route::get('musician_song/{song_id}/right', 'MusicianSongController@right'); | 22 | Route::get('musician_song/{song_id}/right', 'MusicianSongController@right'); |
23 | //经纪约列表 | 23 | //经纪约列表 |
... | @@ -37,6 +37,4 @@ Route::group([], function (){ | ... | @@ -37,6 +37,4 @@ Route::group([], function (){ |
37 | //提现请求 | 37 | //提现请求 |
38 | Route::post('musician/withdraw_prepare', 'App\Controller\Musician\MusicianWithdrawController@prepare'); | 38 | Route::post('musician/withdraw_prepare', 'App\Controller\Musician\MusicianWithdrawController@prepare'); |
39 | 39 | ||
40 | |||
41 | |||
42 | }); | 40 | }); | ... | ... |
-
Please register or sign in to post a comment