diff --git a/app/Http/Controllers/PhotoController.php b/app/Http/Controllers/PhotoController.php index c82e039..205d399 100644 --- a/app/Http/Controllers/PhotoController.php +++ b/app/Http/Controllers/PhotoController.php @@ -9,6 +9,9 @@ use App\Jobs\PhotoDelete; class PhotoController extends Controller { + protected $list_duplicates = 20; + protected $list_deletes = 50; + /** * Create a new controller instance. * @@ -36,7 +39,7 @@ class PhotoController extends Controller { return view('catalog.deletereview',[ 'return'=>url('p/deletes'), - 'catalog'=>is_null($id) ? Photo::where('remove',1)->with('software.model.make')->paginate(10) : Photo::where('id',$id)->paginate(1) + 'catalog'=>is_null($id) ? Photo::where('remove',1)->with('software.model.make')->paginate($this->list_deletes) : Photo::where('id',$id)->paginate(1) ]); } @@ -57,7 +60,7 @@ class PhotoController extends Controller { return view('catalog.duplicatereview',[ 'return'=>url('p/duplicates'), - 'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->with('software.model.make')->paginate(10) : Photo::where('id',$id)->paginate(1) + 'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->with('software.model.make')->paginate($this->list_duplicates) : Photo::where('id',$id)->paginate(1) ]); } diff --git a/app/Models/Abstracted/Catalog.php b/app/Models/Abstracted/Catalog.php index 92a7f50..1f32449 100644 --- a/app/Models/Abstracted/Catalog.php +++ b/app/Models/Abstracted/Catalog.php @@ -115,14 +115,17 @@ abstract class Catalog extends Model { $result = ''; - if ($this->software->model->make) - $result .= $this->software->model->make->name; + if ($this->software_id) { + if ($this->software->model_id) { + if ($this->software->model->make_id) { + $result .= $this->software->model->make->name; + } - if ($this->software->model) - $result .= ($result ? ' ' : '').$this->software->model->name; + $result .= ($result ? ' ' : '').$this->software->model->name; + } - if ($this->software) $result .= ($result ? ' ' : '').$this->software->name; + } return $result; }