|
@@ -49,6 +49,41 @@ class TestCommand extends Command
|
|
|
*/
|
|
|
public function handle()
|
|
|
{
|
|
|
+ // // 转存阿里云oss文件到tos
|
|
|
+ // $audio_effects = DB::table('mp_timbres')->where('id', 246)->get();
|
|
|
+ // $total = count($audio_effects);
|
|
|
+ // $success = 0;
|
|
|
+ // $continue = 0;
|
|
|
+ // $fail = 0;
|
|
|
+ // foreach ($audio_effects as $item) {
|
|
|
+ // $id = getProp($item, 'id');
|
|
|
+ // $url = getProp($item, 'audio_url');
|
|
|
+ // if (!$url) {
|
|
|
+ // $continue++;
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // if (!strstr($url, 'https://cdn-zwai.ycsd.cn')) {
|
|
|
+ // $continue++;
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // $index = strrpos($url, '/');
|
|
|
+ // $filename = mb_substr($url, $index + 1);
|
|
|
+ // $stream = file_get_contents($url);
|
|
|
+ // $new_url = uploadStreamByTos('demonstrate', $stream, $filename);
|
|
|
+ // dd($new_url);
|
|
|
+ // if ($new_url) {
|
|
|
+ // $boolen = DB::table('mp_timbres')->where('id', $id)->update([
|
|
|
+ // 'audio_url' => $new_url,
|
|
|
+ // 'updated_at' => date('Y-m-d H:i:s'),
|
|
|
+ // ]);
|
|
|
+ // if ($boolen) $success++;
|
|
|
+ // else $fail++;
|
|
|
+ // }else {
|
|
|
+ // dump('未生成新url');
|
|
|
+ // $fail++;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // dd("总条数:{$total}, 成功条数:{$success}, 跳过条数:{$continue}, 失败条数:{$fail}");
|
|
|
exit();
|
|
|
// $audio_effects = DB::table('mp_bgms')->where('is_enabled', 1)->where('playtime_seconds', 0)->get();
|
|
|
// foreach ($audio_effects as $audio_effect) {
|