added category filter on clipart
This commit is contained in:
@@ -232,13 +232,25 @@ class AdminModel extends Model
|
||||
return $i;
|
||||
}
|
||||
|
||||
function selectCliparts(){
|
||||
function selectCliparts($cat_id){
|
||||
|
||||
$i = DB::table('cliparts')->select('cliparts.*', 'clipart_categories.CategoryName')
|
||||
->leftjoin('clipart_categories', 'clipart_categories.Id','=','cliparts.CategoryId')
|
||||
->orderby("Id", "DESC")
|
||||
->paginate(16);
|
||||
return $i;
|
||||
if($cat_id != 0 || $cat_id != ""){
|
||||
$i = DB::table('cliparts')->select('cliparts.*', 'clipart_categories.CategoryName')
|
||||
->leftjoin('clipart_categories', 'clipart_categories.Id','=','cliparts.CategoryId')
|
||||
->where('cliparts.CategoryId', $cat_id)
|
||||
->orderby("Id", "DESC")
|
||||
->paginate(16);
|
||||
return $i;
|
||||
}else{
|
||||
$i = DB::table('cliparts')->select('cliparts.*', 'clipart_categories.CategoryName')
|
||||
->leftjoin('clipart_categories', 'clipart_categories.Id','=','cliparts.CategoryId')
|
||||
// ->where('cliparts.CategoryId', $cat_id)
|
||||
->orderby("Id", "DESC")
|
||||
->paginate(16);
|
||||
return $i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user