/** * buildQuery * * @param bool $overrideLimits Param * * @return F0FQuery */ public function buildQuery($overrideLimits = false) { $db = $this->getDBO(); $query = parent::buildQuery($overrideLimits); $query->order($db->qn('name')); return $query; }
public function getAddressesByemail($email) { $db = JFactory::getDbo(); $query = parent::buildQuery($overrideLimits = false); $query->where($this->_db->qn('#__j2store_addresses.email') . ' LIKE ' . $db->q('%' . $email . '%')); $db->setQuery($query); return $db->loadObject(); }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); /* $query = $this->_db->getQuery(true); $query->select($this->_db->qn('#__j2store_product_optionvalues').'.*')->from($this->_db->qn('#__j2store_product_optionvalues').' AS '.$this->_db->qn('#__j2store_product_optionvalues')); */ $query->select('#__j2store_optionvalues.optionvalue_name, #__j2store_optionvalues.optionvalue_image')->join('LEFT OUTER', '#__j2store_optionvalues ON #__j2store_optionvalues.j2store_optionvalue_id = #__j2store_product_optionvalues.optionvalue_id'); return $query; }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); $query->select('#__j2store_countries.country_name as country_name'); $query->join('LEFT OUTER', '#__j2store_countries ON #__j2store_addresses.country_id = #__j2store_countries.j2store_country_id'); $query->select('#__j2store_zones.zone_name as zone_name'); $query->join('LEFT OUTER', '#__j2store_zones ON #__j2store_addresses.zone_id = #__j2store_zones.j2store_zone_id'); return $query; }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); if ($this->getState('orderByLabels')) { $query->clear('order'); $query->order('country ASC, label ASC'); } return $query; }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); $query->select('#__j2store_options.option_unique_name, #__j2store_options.option_name, #__j2store_options.type')->join('LEFT OUTER', '#__j2store_options ON #__j2store_options.j2store_option_id = #__j2store_product_options.option_id'); $parent_id = $this->getState('parent_id', null); if (isset($parent_id) && !is_null($parent_id)) { $query->where($this->_db->qn('#__j2store_product_options.parent_id') . ' = ' . $this->_db->q($parent_id)); } return $query; }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); $query->select($this->_db->qn('#__j2store_productquantities') . '.j2store_productquantity_id ')->select($this->_db->qn('#__j2store_productquantities') . '.quantity')->join('LEFT OUTER', '#__j2store_productquantities ON #__j2store_productquantities.variant_id = #__j2store_variants.j2store_variant_id'); // get the weight class $query->select($this->_db->qn('#__j2store_weights') . '.weight_title')->select($this->_db->qn('#__j2store_weights') . '.weight_unit')->join('LEFT OUTER', '#__j2store_weights ON #__j2store_weights.j2store_weight_id = #__j2store_variants.weight_class_id'); // get the length class $query->select($this->_db->qn('#__j2store_lengths') . '.length_title')->select($this->_db->qn('#__j2store_lengths') . '.length_unit')->join('LEFT OUTER', '#__j2store_lengths ON #__j2store_lengths.j2store_length_id = #__j2store_variants.length_class_id'); //the following joins run only when the product type is Variable $product_type = $this->getState('product_type'); if ($product_type == 'variable' || $product_type == 'advancedvariable') { $query->select('#__j2store_product_variant_optionvalues.product_optionvalue_ids AS variant_name')->join('INNER', '#__j2store_product_variant_optionvalues ON #__j2store_product_variant_optionvalues.variant_id = #__j2store_variants.j2store_variant_id'); } return $query; }
public function buildQuery($overrideLimits = false) { $db = $this->getDbo(); $query = parent::buildQuery($overrideLimits)->clear('select')->clear('order')->select(array($db->quoteName('admintools_scanalert_id'), 'IF(' . $db->quoteName('diff') . ' != "",0,1) AS ' . $db->quoteName('newfile'), 'IF(' . $db->quoteName('diff') . ' LIKE "###SUSPICIOUS FILE###%",1,0) AS ' . $db->quoteName('suspicious'), 'IF(' . $db->quoteName('diff') . ' != "",' . 'IF(' . $db->quoteName('diff') . ' LIKE "###SUSPICIOUS FILE###%",' . $db->quote('0-suspicious') . ',' . $db->quote('2-modified') . ')' . ',' . $db->quote('1-new') . ') AS ' . $db->quoteName('filestatus'), $db->quoteName('path'), $db->quoteName('threat_score'), $db->quoteName('acknowledged'))); $search = $this->getState('search', ''); if ($search) { $query->where($db->qn('path') . ' LIKE ' . $db->q('%' . $search . '%')); } $status = $this->getState('status', ''); switch ($status) { case 'new': $query->where('IF(' . $db->quoteName('diff') . ' != "",0,1) = ' . $db->q(1)); break; case 'suspicious': $query->where('IF(' . $db->quoteName('diff') . ' LIKE "###SUSPICIOUS FILE###%",1,0) = ' . $db->q(1)); break; case 'modified': $query->where('IF(' . $db->quoteName('diff') . ' != "",0,1) = ' . $db->q(0)); $query->where('IF(' . $db->quoteName('diff') . ' LIKE "###SUSPICIOUS FILE###%",1,0) = ' . $db->q(0)); break; } $safe = $this->getState('safe', ''); if (is_numeric($safe) && $safe != '-1') { $query->where($db->qn('acknowledged') . ' = ' . $db->q($safe)); } if (!$overrideLimits) { $order = $this->getState('filter_order', null, 'cmd'); $dir = $this->getState('filter_order_Dir', 'ASC', 'cmd'); if (!in_array($order, array('path', 'threat_score', 'acknowledged', 'filestatus', 'newfile', 'suspcious'))) { $order = 'threat_score'; $dir = 'DESC'; } $query->order($db->quoteName($order) . ' ' . $dir); } return $query; }
public function buildQuery($overrideLimites = false) { $db = JFactory::getDbo(); $query = parent::buildQuery($overrideLimites); $query->select($this->_db->qn('#__j2store_orderstatuses.orderstatus_name')); $query->select($this->_db->qn('#__j2store_orderstatuses.orderstatus_cssclass')); $query->select("CASE WHEN #__j2store_orders.invoice_prefix IS NULL or #__j2store_orders.invoice_number = 0 THEN\n\t\t\t\t\t\t#__j2store_orders.j2store_order_id\n \t\t\t\t\tELSE\n\t\t\t\t\t\tCONCAT(#__j2store_orders.invoice_prefix, #__j2store_orders.invoice_number)\n\t\t\t\t\tEND\n\t\t\t\t \tAS invoice"); $query->join('LEFT OUTER', '#__j2store_orderstatuses ON #__j2store_orders.order_state_id = #__j2store_orderstatuses.j2store_orderstatus_id'); $query->select($this->_db->qn('#__j2store_orderinfos.billing_first_name')); $query->select($this->_db->qn('#__j2store_orderinfos.billing_last_name')); $query->join('LEFT OUTER', '#__j2store_orderinfos ON #__j2store_orders.order_id = #__j2store_orderinfos.order_id'); $limit_orderstatuses = $this->getState('orderstatuses', '*'); $limit_orderstatuses = explode(',', $limit_orderstatuses); if (!in_array('*', $limit_orderstatuses)) { $query->where('#__j2store_orders.order_state_id IN (' . implode(',', $limit_orderstatuses) . ')'); } return $query; }
public function buildQuery($overrideLimits = false) { $query = parent::buildQuery($overrideLimits); if (!$overrideLimits) { $db = $this->getDbo(); $table = $this->getTable(); $tableName = $table->getTableName(); $tableKey = $table->getKeyName(); $order = $this->getState('filter_order', null, 'cmd'); if (!in_array($order, array_keys($this->getTable()->getData()))) { $order = $tableKey; } $dir = $this->getState('filter_order_Dir', 'DESC', 'cmd'); $query->order($db->qn($order) . ' ' . $dir); } return $query; }