getWeekdays example

return $condition instanceof OrderedAtWeekdayCondition;
    }

    public function handle(ConditionInterface $condition, QueryBuilder $query)
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(OrderedAtWeekdayCondition $condition, QueryBuilder $query): void
    {
        $wheres = [];
        foreach ($condition->getWeekdays() as $i => $id) {
            $wheres[] = 'customer.ordered_at_weekdays LIKE :weekday' . $i;
            $query->setParameter(':weekday' . $i, '%|' . $id . '|%');
        }
        $query->andWhere(implode(' OR ', $wheres));
    }
}
'state_id' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStateId() : '',
            'age' => $customer->getAge(),
            'count_orders' => (int) $customer->getOrderInformation()->getOrderCount(),
            'product_avg' => (float) $customer->getOrderInformation()->getAvgProductPrice(),
            'invoice_amount_sum' => (float) $customer->getOrderInformation()->getTotalAmount(),
            'invoice_amount_avg' => (float) $customer->getOrderInformation()->getAvgAmount(),
            'invoice_amount_min' => (float) $customer->getOrderInformation()->getMinAmount(),
            'invoice_amount_max' => (float) $customer->getOrderInformation()->getMaxAmount(),
            'first_order_time' => $this->formatDate($customer->getOrderInformation()->getFirstOrderTime()),
            'last_order_time' => $this->formatDate($customer->getOrderInformation()->getLastOrderTime()),
            'has_canceled_orders' => $customer->getOrderInformation()->hasCanceledOrders(),
            'ordered_at_weekdays' => $this->implodeUnique($customer->getOrderInformation()->getWeekdays()),
            'ordered_in_shops' => $this->implodeUnique($customer->getOrderInformation()->getShops()),
            'ordered_on_devices' => $this->implodeUnique($customer->getOrderInformation()->getDevices()),
            'ordered_with_deliveries' => $this->implodeUnique($customer->getOrderInformation()->getDispatches()),
            'ordered_with_payments' => $this->implodeUnique($customer->getOrderInformation()->getPayments()),
            'ordered_products' => $this->implodeUnique($customer->getOrderInformation()->getProducts()),
            'ordered_products_of_categories' => $this->implodeUnique($customer->getOrderInformation()->getCategories()),
            'ordered_products_of_manufacturer' => $this->implodeUnique($customer->getOrderInformation()->getManufacturers()),
        ];

        return $data;
    }

    
Home | Imprint | This part of the site doesn't use cookies.