Added checks in Product::deleteAction()

This commit is contained in:
Frank Schubert
2024-02-21 15:56:15 +01:00
parent de39dd6946
commit b833c57a98
4 changed files with 68 additions and 3 deletions

View File

@@ -100,7 +100,25 @@ class OrderProductModel
}
return null;
}
public static function count($filter) {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$sql = "SELECT COUNT(*) as cnt FROM OrderProduct
WHERE $where
";
mfLoghandler::singleton()->debug($sql);
$res = $db->query($sql);
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
return $data->cnt;
}
return 0;
}
public static function search($filter)
{
$items = [];