1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-04 12:00:27 +01:00
openstamanager/modules/articoli/api/v1/Articoli.php
2019-07-19 16:51:52 +02:00

22 lines
545 B
PHP

<?php
namespace Modules\Articoli\API\v1;
use API\Interfaces\RetrieveInterface;
use API\Resource;
class Articoli extends Resource implements RetrieveInterface
{
public function retrieve($request)
{
$query = 'SELECT *,
(SELECT nome FROM mg_categorie WHERE id = mg_articoli.id_categoria) AS categoria,
(SELECT nome FROM mg_categorie WHERE id = mg_articoli.id_sottocategoria) AS sottocategoria
FROM mg_articoli WHERE attivo = 1';
return [
'query' => $query,
];
}
}