You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some raw sql strings in HomeControler.php will fail if using a table prefix configuration in config/database.php.
The following code will fix that:
public function index()
{
$tbpfx = DB::getTablePrefix();
$news = $this->news->orderBy('position', 'DESC')->orderBy('created_at', 'DESC')->limit(4)->get();
$sliders = Photo::join('photo_album', 'photo_album.id','=','photo.photo_album_id')
->where('photo.slider',1)
->orderBy('photo.position', 'DESC')
->orderBy('photo.created_at', 'DESC')
->select('photo.filename','photo.name','photo.description','photo_album.folderid')->get();
$photoalbums = PhotoAlbum::select(array('photo_album.id', 'photo_album.name', 'photo_album.description',
'photo_album.folderid',
DB::raw("(select filename from ${tbpfx}photo as p WHERE album_cover=1 and p.photo_album_id=${tbpfx}photo_album.id) AS album_image"),
DB::raw("(select filename from ${tbpfx}photo as p WHERE p.photo_album_id=${tbpfx}photo_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first")))->limit(8)->get();
$videoalbums = VideoAlbum::select(array('video_album.id', 'video_album.name', 'video_album.description',
'video_album.folderid',
DB::raw("(select youtube from ${tbpfx}video as v WHERE album_cover=1 and v.video_album_id=${tbpfx}video_album.id) AS album_image"),
DB::raw("(select youtube from ${tbpfx}video as v WHERE v.video_album_id=${tbpfx}video_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first")))->limit(8)->get();
return view('site.home.index',compact('news','sliders','videoalbums','photoalbums'));
}
I don't check others but that's it!
Many thanks for this repository.
The text was updated successfully, but these errors were encountered:
Some raw sql strings in HomeControler.php will fail if using a table prefix configuration in config/database.php.
The following code will fix that:
I don't check others but that's it!
Many thanks for this repository.
The text was updated successfully, but these errors were encountered: