syncAvatar(); // $this->syncAttires(); // $this->syncGift(); // $this->syncPack(); // $this->syncLiveRoom(); // $this->syncResource(); return 0; } public function syncAvatar() { $avatars = \App\Models\Account::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->avatar, Storage::disk('admin')->get($item->avatar)); if(!$v) { dump("出错了".$item->avatar); } else { dump("ok".$item->avatar); } }); } public function syncAttires() { $avatars = \App\Models\Attire::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->img_1, Storage::disk('admin')->get($item->img_1)); if(!$v) { dump("出错了".$item->img_1); } else { dump("ok".$item->img_1); } $v = Storage::disk("cosv5")->put($item->img_2, Storage::disk('admin')->get($item->img_2)); if(!$v) { dump("出错了".$item->img_2); } else { dump("ok".$item->img_2); } }); } public function syncGift() { $avatars = \App\Models\Gift::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->img, Storage::disk('admin')->get($item->img)); if(!$v) { dump("出错了".$item->img); } else { dump("ok".$item->img); } }); } public function syncPack() { $avatars = \App\Models\GiftPack::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->img, Storage::disk('admin')->get($item->img)); if(!$v) { dump("出错了-".$item->img); } else { dump("ok-".$item->img); } }); } public function syncLiveRoom() { $avatars = \App\Models\LiveRoom::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->img, Storage::disk('admin')->get($item->img)); if(!$v) { dump("出错了-".$item->img); } else { dump("ok-".$item->img); } }); } public function syncResource() { $avatars = \App\Models\Resource::all(); $avatars->each(function ($item, $key) { $v = Storage::disk("cosv5")->put($item->src, Storage::disk('admin')->get($item->src)); if(!$v) { dump("出错了-".$item->src); } else { dump("ok-".$item->src); } }); } }