Skip to content
Snippets Groups Projects
Verified Commit 005d87a7 authored by Jonas Leder's avatar Jonas Leder
Browse files

add lastUpdate as option for graphQL

parent 1fd4c18a
No related branches found
No related tags found
Loading
......@@ -13,6 +13,7 @@ $product = new ObjectType([
"amount" => Type::int(),
"position" => Type::string(),
"positionid" => Type::int(),
"lastUpdate" => Type::int(),
]
]);
......@@ -20,7 +21,7 @@ function products($conn, $limit = -1, $offset = 0)
{
$limit = $conn->real_escape_string($limit);
$offset = $conn->real_escape_string($offset);
$query = "SELECT products.id, manufacturer.name AS manufacturer, manufacturer.id AS manufacturerid, products.name, amount, position.name AS position, position.id AS positionid FROM products INNER JOIN position ON products.position = position.id INNER JOIN manufacturer ON products.manufacturer = manufacturer.id";
$query = "SELECT products.id, manufacturer.name AS manufacturer, manufacturer.id AS manufacturerid, products.name, amount, position.name AS position, position.id AS positionid, lastUpdate FROM products INNER JOIN position ON products.position = position.id INNER JOIN manufacturer ON products.manufacturer = manufacturer.id";
if ($limit > 0) {
$query .= " LIMIT $limit OFFSET $offset";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment