예제 #1
0
    /**
     * @param IOrderList $orderList
     *
     * @return IOrderListFilter
     */
    public function apply(IOrderList $orderList)
    {
        // init
        $query = $orderList->getQuery();
        if ($this->getKeyword()) {
            $condition = <<<'SQL'
0
OR `order`.ordernumber like ?
OR `order`.comment like ?

OR `order`.customerName like ?
OR `order`.customerCompany like ?
OR `order`.customerStreet like ?
OR `order`.customerZip like ?
OR `order`.customerCity like ?
OR `order`.customerCountry like ?

OR `order`.deliveryName like ?
OR `order`.deliveryCompany like ?
OR `order`.deliveryStreet like ?
OR `order`.deliveryZip like ?
OR `order`.deliveryCity like ?
OR `order`.deliveryCountry like ?
SQL;
            $query->where($condition, '%' . $this->getKeyword() . '%');
        }
    }
예제 #2
0
 /**
  * @param IOrderList $orderList
  *
  * @return IOrderListFilter
  */
 public function apply(IOrderList $orderList)
 {
     // init
     $orderList->joinOrderItemObjects();
     // quote
     $types = [];
     foreach ($this->getTypes() as $t) {
         $types[] = $orderList->getQuery()->getAdapter()->quote($t);
     }
     $orderList->getQuery()->where(sprintf('orderItemObjects.o_className in("%s")', implode('","', $types)));
 }
예제 #3
0
 /**
  * @param IOrderList $orderList
  *
  * @return IOrderListFilter
  */
 public function apply(IOrderList $orderList)
 {
     // init
     $query = $orderList->getQuery();
     if ($this->getFrom()) {
         $query->where('order.orderDate >= ?', $this->getFrom()->getTimestamp());
     }
     if ($this->getTill()) {
         $query->where('order.orderDate <= ?', $this->getTill()->getTimestamp());
     }
 }