added clipart category
This commit is contained in:
@@ -146,6 +146,15 @@ class AdminModel extends Model
|
||||
return $i;
|
||||
}
|
||||
|
||||
function ClipartCategory(){
|
||||
$i = DB::table('clipart_categories')
|
||||
->leftjoin('user_logins', 'clipart_categories.UserId', '=', 'user_logins.id')
|
||||
->select('clipart_categories.*', 'user_logins.username')
|
||||
->orderby('clipart_categories.Ordering', 'ASC')
|
||||
->paginate(18);
|
||||
return $i;
|
||||
}
|
||||
|
||||
function selectStoreOwners($store_id){
|
||||
$i = DB::table('user_logins')
|
||||
->where('role', 'store_owner')
|
||||
@@ -156,7 +165,7 @@ class AdminModel extends Model
|
||||
|
||||
function insertClipartCategory($data){
|
||||
|
||||
$i = DB::table('clipart_categories')->insert($data);
|
||||
$i = DB::table('clipart_categories')->insertGetId($data);
|
||||
return $i;
|
||||
}
|
||||
|
||||
@@ -166,6 +175,11 @@ class AdminModel extends Model
|
||||
return $i;
|
||||
}
|
||||
|
||||
function updateClipartCatOrdering($order, $id){
|
||||
$i = DB::table('clipart_categories')->where('Id', $id)
|
||||
->update(['Ordering' => $order]);
|
||||
}
|
||||
|
||||
|
||||
function userList(){
|
||||
$i = DB::table('user_logins')
|
||||
@@ -193,6 +207,34 @@ class AdminModel extends Model
|
||||
->update(['role'=> 'user', 'store_id'=> $data['store_id']]);
|
||||
return $i;
|
||||
}
|
||||
|
||||
function deleteClipartCategory($id){
|
||||
|
||||
$i = DB::table('clipart_categories')
|
||||
->where("Id", $id)
|
||||
->delete();
|
||||
return $i;
|
||||
}
|
||||
|
||||
function updateClipartCategory($id, $data){
|
||||
|
||||
$i = DB::table('clipart_categories')
|
||||
->where("Id", $id)
|
||||
->update($data);
|
||||
return $i;
|
||||
}
|
||||
|
||||
function selectCliparts(){
|
||||
|
||||
$i = DB::table('cliparts')
|
||||
->orderby("Id", "DESC")
|
||||
->paginate(16);
|
||||
return $i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user