31 private $catalogRuleGroupWebsiteColumnsList = [
'rule_id',
'customer_group_id',
'website_id'];
36 private $activeTableSwitcher;
41 private $tableSwapper;
53 TableSwapper $tableSwapper =
null 57 $this->activeTableSwitcher = $activeTableSwitcher;
58 $this->tableSwapper = $tableSwapper ??
68 public function execute($useAdditionalTable =
false)
71 $timestamp = $this->dateTime->gmtTimestamp();
73 $indexTable = $this->resource->getTableName(
'catalogrule_group_website');
74 $ruleProductTable = $this->resource->getTableName(
'catalogrule_product');
75 if ($useAdditionalTable) {
76 $indexTable = $this->resource->getTableName(
77 $this->tableSwapper->getWorkingTableName(
'catalogrule_group_website')
79 $ruleProductTable = $this->resource->getTableName(
80 $this->tableSwapper->getWorkingTableName(
'catalogrule_product')
89 $this->catalogRuleGroupWebsiteColumnsList
91 "{$timestamp} >= from_time AND (({$timestamp} <= to_time AND to_time > 0) OR to_time = 0)" 93 $query =
$select->insertFromSelect($indexTable, $this->catalogRuleGroupWebsiteColumnsList);
__construct(\Magento\Framework\Stdlib\DateTime\DateTime $dateTime, \Magento\Framework\App\ResourceConnection $resource, ActiveTableSwitcher $activeTableSwitcher, TableSwapper $tableSwapper=null)
execute($useAdditionalTable=false)