public function deletePhoto($id) { try { $file = UserGallery::where('user_id', user()->user_id)->find($id); if ($file) { $file->delete(); return $this->rest()->success(array(), '删除成功'); } return $this->rest()->error('文件不存在'); } catch (\Exception $e) { return $this->rest()->error('删除失败'); } }
public function getGallerylist() { $users = UserGallery::with('user')->where('status', UserEnum::GALLERY_CHECK)->paginate(15); return $this->view('gallery')->with('users', $users); }