Now can reactivate a nonactive category
This commit is contained in:
@@ -220,7 +220,7 @@ abstract class Model
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($table, $id)
|
||||
public function delete($table, $id, $force = '')
|
||||
{
|
||||
try {
|
||||
$db = static::connectDB();
|
||||
@@ -228,7 +228,11 @@ abstract class Model
|
||||
$sql = "UPDATE {$table} SET status = ? WHERE id = ?";
|
||||
|
||||
$query = $db->prepare($sql);
|
||||
$query->bindValue(1, 3);
|
||||
if (is_int($force)) {
|
||||
$query->bindValue(1, $force);
|
||||
} else {
|
||||
$query->bindValue(1, 3);
|
||||
}
|
||||
$query->bindValue(2, $id);
|
||||
|
||||
$query->execute();
|
||||
|
||||
Reference in New Issue
Block a user