增加字段
Showing
2 changed files
with
5 additions
and
2 deletions
| ... | @@ -101,7 +101,7 @@ class SongController extends Controller | ... | @@ -101,7 +101,7 @@ class SongController extends Controller | 
| 101 | 101 | ||
| 102 | public function coverFiles($song_files): array | 102 | public function coverFiles($song_files): array | 
| 103 | { | 103 | { | 
| 104 | $files_need = ['mp3_url', 'accompany_mp3_url', 'cover_url', 'wav_url', 'accompany_wav_url']; | 104 | $files_need = ['mp3_url', 'accompany_mp3_url', 'lyric_url', 'cover_url', 'wav_url', 'accompany_wav_url']; | 
| 105 | $files_arr = []; | 105 | $files_arr = []; | 
| 106 | foreach ($song_files as $file) { | 106 | foreach ($song_files as $file) { | 
| 107 | switch ($file['type']) { | 107 | switch ($file['type']) { | 
| ... | @@ -111,6 +111,9 @@ class SongController extends Controller | ... | @@ -111,6 +111,9 @@ class SongController extends Controller | 
| 111 | case 2: | 111 | case 2: | 
| 112 | $files_arr['accompany_mp3_url'] = $file['url']; | 112 | $files_arr['accompany_mp3_url'] = $file['url']; | 
| 113 | break; | 113 | break; | 
| 114 | case 3: | ||
| 115 | $files_arr['lyric_url'] = $file['url']; | ||
| 116 | break; | ||
| 114 | case 4: | 117 | case 4: | 
| 115 | $files_arr['cover_url'] = $file['url']; | 118 | $files_arr['cover_url'] = $file['url']; | 
| 116 | break; | 119 | break; | ... | ... | 
| ... | @@ -14,7 +14,7 @@ class Song extends BaseModel | ... | @@ -14,7 +14,7 @@ class Song extends BaseModel | 
| 14 | { | 14 | { | 
| 15 | use HasFactory,SoftDeletes; | 15 | use HasFactory,SoftDeletes; | 
| 16 | 16 | ||
| 17 | protected static $file_only = [1,2,4,11,12]; | 17 | protected static $file_only = [1,2,3,4,11,12]; | 
| 18 | 18 | ||
| 19 | /** | 19 | /** | 
| 20 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany | 20 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany | ... | ... | 
- 
Please register or sign in to post a comment
