public with sharing class ReferenzkundeNachKategorie {
@AuraEnabled
public static List<AggregateResult> getList (String main) {
list<AggregateResult> CampaignList = [
SELECT company__c, Count(Id)
FROM Anzeigen_bersicht__c
WHERE Start_in_Tagen__c <= 365 AND id in (select Anzeigen__c FROM Kategorie__c WHERE Main__c = :main)
GROUP BY company__c
ORDER BY Count(Id) DESC
LIMIT 10
];
return CampaignList;
}}
public with sharing class ReferenzkundeNachKategorie {
@AuraEnabled
public static List<AggregateResult> getList (String main) {
list<AggregateResult> CampaignList = [
SELECT company__c, Count(Id)
FROM Anzeigen_bersicht__c
WHERE Start_in_Tagen__c <= 365 AND id in (select Anzeigen__c FROM Kategorie__c WHERE Main__c = :main)
GROUP BY company__c
ORDER BY Count(Id) DESC
LIMIT 10
];
return CampaignList;
}}
<aura:component controller = "ReferenzkundeNachKategorie" implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:availableForFlowScreens" access="global" >
<aura:attribute name="AnzeigenList" type="list" />
<aura:attribute type="AggregateResult[]" name="CampaignList" />
<aura:attribute name="mycolumns" type="list" />
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:datatable data="{! v.CampaignList }"
columns="{! v.AnzeigenList }"
keyField="id"
hideCheckboxColumn="true"/>
</aura:component>
<aura:component controller = "ReferenzkundeNachKategorie" implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:availableForFlowScreens" access="global" >
<aura:attribute name="AnzeigenList" type="list" />
<aura:attribute type="AggregateResult[]" name="CampaignList" />
<aura:attribute name="mycolumns" type="list" />
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:datatable data="{! v.CampaignList }"
columns="{! v.AnzeigenList }"
keyField="id"
hideCheckboxColumn="true"/>
</aura:component>
({
init: function(component, event, helper) {
component.set('v.AnzeigenList', [
{label: 'Unternehmen', fieldName: 'company__c', type: 'text'},
{label: 'Anzahl Anzeigen', fieldName: 'expr0', type: 'integer'}
]);
var campList = component.get("c.getList");
campList.setParams
({
main: component.get("v.main__c")
});
campList.setCallback(this, function(data)
{
component.set("v.CampaignList", data.getReturnValue());
});
$A.enqueueAction(campList);
}
})
({
init: function(component, event, helper) {
component.set('v.AnzeigenList', [
{label: 'Unternehmen', fieldName: 'company__c', type: 'text'},
{label: 'Anzahl Anzeigen', fieldName: 'expr0', type: 'integer'}
]);
var campList = component.get("c.getList");
campList.setParams
({
main: component.get("v.main__c")
});
campList.setCallback(this, function(data)
{
component.set("v.CampaignList", data.getReturnValue());
});
$A.enqueueAction(campList);
}
})