add shop group, improve inactive categories export
This commit is contained in:
parent
400554ea9c
commit
5b8867b1e8
@ -16,6 +16,7 @@ declare(strict_types=1);
|
|||||||
namespace D3\DataWizard\Application\Model;
|
namespace D3\DataWizard\Application\Model;
|
||||||
|
|
||||||
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
|
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
|
||||||
|
use D3\DataWizard\Application\Model\Exports\KeyFigures;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
class Configuration
|
class Configuration
|
||||||
|
@ -28,6 +28,14 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
|
|
||||||
abstract class ExportBase implements QueryBase
|
abstract class ExportBase implements QueryBase
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDescription() : string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $format
|
* @param string $format
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
namespace D3\DataWizard\Application\Model\Exports;
|
namespace D3\DataWizard\Application\Model\Exports;
|
||||||
|
|
||||||
use D3\DataWizard\Application\Model\ExportBase;
|
use D3\DataWizard\Application\Model\ExportBase;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Article;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Category;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Object2Category;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
class InactiveCategories extends ExportBase
|
class InactiveCategories extends ExportBase
|
||||||
@ -32,37 +35,43 @@ class InactiveCategories extends ExportBase
|
|||||||
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES');
|
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getDescription() : string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQuery() : array
|
public function getQuery() : array
|
||||||
{
|
{
|
||||||
|
$categoryTableName = oxNew(Category::class)->getCoreTableName();
|
||||||
|
$object2categoryTableName = oxNew(Object2Category::class)->getCoreTableName();
|
||||||
|
$articleTableName = oxNew(Article::class)->getCoreTableName();
|
||||||
|
|
||||||
|
$treeTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TREE');
|
||||||
|
$titleTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TITLE');
|
||||||
|
$countTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_COUNT');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"SELECT
|
"SELECT
|
||||||
oc.OXID,
|
oc.OXID,
|
||||||
oc.OXSHOPID,
|
oc.OXSHOPID,
|
||||||
oc.oxtitle as 'Titel',
|
oc.oxtitle as :titleTitle,
|
||||||
(
|
(
|
||||||
SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ')
|
SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ')
|
||||||
from oxcategories
|
from ".$categoryTableName."
|
||||||
WHERE OXLEFT < oc.oxleft AND OXRIGHT > oc.oxright AND OXROOTID = oc.OXROOTID AND OXSHOPID = oc.OXSHOPID
|
WHERE OXLEFT < oc.oxleft AND OXRIGHT > oc.oxright AND OXROOTID = oc.OXROOTID AND OXSHOPID = oc.OXSHOPID
|
||||||
) as 'Baum',
|
) as :treeTitle,
|
||||||
COUNT(oa.oxid) as 'Anzahl'
|
COUNT(oa.oxid) as :countTitle
|
||||||
FROM oxcategories oc
|
FROM ".$categoryTableName." oc
|
||||||
LEFT JOIN oxobject2category o2c ON oc.OXID = o2c.OXCATNID
|
LEFT JOIN ".$object2categoryTableName." o2c ON oc.OXID = o2c.OXCATNID
|
||||||
LEFT JOIN oxarticles oa ON o2c.OXOBJECTID = oa.OXID
|
LEFT JOIN ".$articleTableName." oa ON o2c.OXOBJECTID = oa.OXID
|
||||||
WHERE oc.OXACTIVE = ? AND oa.OXACTIVE = ?
|
WHERE oc.OXACTIVE = :categoryActive AND oa.OXACTIVE = :articleActive
|
||||||
GROUP BY oc.oxid
|
GROUP BY oc.oxid
|
||||||
ORDER BY oc.oxleft ASC",
|
ORDER BY oc.oxleft ASC",
|
||||||
[0, 1]
|
[
|
||||||
|
'categoryActive' => 0,
|
||||||
|
'articleActive' => 1,
|
||||||
|
'titleTitle' => $titleTitle,
|
||||||
|
'treeTitle' => $treeTitle,
|
||||||
|
'countTitle' => $countTitle
|
||||||
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,9 +30,10 @@ $aLang = array(
|
|||||||
|
|
||||||
'D3_DATAWIZARD_GROUP_ARTICLES' => 'Artikel',
|
'D3_DATAWIZARD_GROUP_ARTICLES' => 'Artikel',
|
||||||
'D3_DATAWIZARD_GROUP_CATEGORIES' => 'Kategorien',
|
'D3_DATAWIZARD_GROUP_CATEGORIES' => 'Kategorien',
|
||||||
'D3_DATAWIZARD_GROUP_REMARKS' => 'Bewertungen',
|
|
||||||
'D3_DATAWIZARD_GROUP_USERS' => 'Benutzer',
|
|
||||||
'D3_DATAWIZARD_GROUP_ORDERS' => 'Bestellungen',
|
'D3_DATAWIZARD_GROUP_ORDERS' => 'Bestellungen',
|
||||||
|
'D3_DATAWIZARD_GROUP_REMARKS' => 'Bewertungen',
|
||||||
|
'D3_DATAWIZARD_GROUP_SHOP' => 'Shop',
|
||||||
|
'D3_DATAWIZARD_GROUP_USERS' => 'Benutzer',
|
||||||
|
|
||||||
'D3_DATAWIZARD_EXPORT_SUBMIT' => 'Export starten',
|
'D3_DATAWIZARD_EXPORT_SUBMIT' => 'Export starten',
|
||||||
'D3_DATAWIZARD_EXPORT_FORMAT_CSV' => 'CSV-Format',
|
'D3_DATAWIZARD_EXPORT_FORMAT_CSV' => 'CSV-Format',
|
||||||
@ -45,7 +46,15 @@ $aLang = array(
|
|||||||
'D3_DATAWIZARD_ERR_NOEXPORTCONTENT' => 'Export ist leer, kein Inhalt zum Download verfügbar',
|
'D3_DATAWIZARD_ERR_NOEXPORTCONTENT' => 'Export ist leer, kein Inhalt zum Download verfügbar',
|
||||||
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert',
|
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert',
|
||||||
|
|
||||||
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel'
|
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TREE' => 'Baum',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TITLE' => 'Titel',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_COUNT' => 'Anzahl',
|
||||||
|
|
||||||
|
'D3_DATAWIZARD_EXPORTS_KEYFIGURES' => 'Bestellungskennzahlen nach Monat',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'Bestellungen pro Monat',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe',
|
||||||
|
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH' => 'Monat',
|
||||||
|
|
||||||
// Abracadata
|
// Abracadata
|
||||||
// Harry Potter
|
// Harry Potter
|
||||||
|
@ -26,7 +26,7 @@ $logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="he
|
|||||||
*/
|
*/
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => $sModuleId,
|
'id' => $sModuleId,
|
||||||
'title' => $logo.' Data Wizard framework',
|
'title' => $logo.' Data Wizard',
|
||||||
'description' => [
|
'description' => [
|
||||||
'de' => '',
|
'de' => '',
|
||||||
'en' => '',
|
'en' => '',
|
||||||
|
Loading…
Reference in New Issue
Block a user