Skip to content

Instantly share code, notes, and snippets.

@chanakaDe
Created August 1, 2016 19:06
Show Gist options
  • Save chanakaDe/fee74b87330b0f7f59dbae1e2c99868e to your computer and use it in GitHub Desktop.
Save chanakaDe/fee74b87330b0f7f59dbae1e2c99868e to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use DB;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class BoxsetController extends Controller
{
public function index($offset)
{
$Sesries = DB::table('tblseries')->select('seriesid', 'seriesname', 'imagepath', 'views', 'scenes')->where('active', '=', 'y')->whereIn('site', [1, 3])->skip($offset)->take(6)->get();
return response()->json($Sesries);
}
public function getByMostRecent($offset)
{
$Sesries = DB::table('tblseries')->select('seriesid', 'seriesname', 'imagepath', 'views', 'scenes')->where('active', '=', 'y')->whereIn('site', [1, 3])->orderBy('lastupdated', 'desc')->skip($offset)->take(6)->get();
return response()->json($Sesries);
}
public function getByPopularity($offset)
{
$Sesries = DB::table('tblseries')->select('seriesid', 'seriesname', 'imagepath', 'views', 'scenes')->where('active', '=', 'y')->whereIn('site', [1, 3])->orderBy('views', 'desc')->skip($offset)->take(6)->get();
return response()->json($Sesries);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment