Commit 0b30a2d0 authored by Feu's avatar Feu

nettoyage auto

parent c894455c
......@@ -313,7 +313,6 @@ class debitfacture extends stdentity
}
$req = new delete ($this->dbrw,"cpt_vendu",array("id_facture" => $this->id));
$req = new delete ($this->dbrw,"cpt_vendu_cotisant",array("id_facture" => $this->id));
$req = new delete ($this->dbrw,"cpt_debitfacture",array("id_facture" => $this->id));
}
......
......@@ -29,5 +29,13 @@ while ( $row = $req->get_row() )
$vp->debloquer ( $client, $row['quantite'] );
}
// Tâche 2 : Nettotage des produits (et eventuels verrous liés), et des types
$req = new requete($site->dbrw,"DELETE FROM `cpt_produits` WHERE prod_archive=1 AND NOT EXISTS(SELECT * FROM cpt_vendu WHERE cpt_vendu.id_produit=cpt_produits.id_produit)");
$req = new requete($site->dbrw,"DELETE FROM `cpt_verrou` WHERE NOT EXISTS(SELECT * FROM cpt_produits WHERE cpt_verrou.id_produit=cpt_produits.id_produit)");
$req = new requete($site->dbrw,"DELETE FROM `cpt_type_produit` WHERE NOT EXISTS ( SELECT * FROM cpt_produits WHERE cpt_produits.id_typeprod=cpt_type_produit.id_typeprod)");
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment