當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Db_Adapter_Interface::getCaseSql方法代碼示例

本文整理匯總了PHP中Varien_Db_Adapter_Interface::getCaseSql方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Db_Adapter_Interface::getCaseSql方法的具體用法?PHP Varien_Db_Adapter_Interface::getCaseSql怎麽用?PHP Varien_Db_Adapter_Interface::getCaseSql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Db_Adapter_Interface的用法示例。


在下文中一共展示了Varien_Db_Adapter_Interface::getCaseSql方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _wrapBodyWithCond

 /**
  * Wrap trigger body with conditions
  *
  * @param string $body
  * @param array $conditions
  * @param string $conditionsLogic
  * @return string
  */
 protected function _wrapBodyWithCond($body, $conditions = array(), $conditionsLogic = Zend_Db_Select::SQL_OR)
 {
     if (empty($conditions)) {
         return $body;
     }
     return $this->_connection->getCaseSql($this->getEventConditionsSql($conditions, $conditionsLogic), array('TRUE' => new Zend_Db_Expr('BEGIN ' . $body . ' END;')), new Zend_Db_Expr('BEGIN END;')) . " CASE;";
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:15,代碼來源:Trigger.php

示例2: _getCategorySeoSuffixCaseSql

 /**
  * Get case sql for define category seo suffix by store
  *
  * @param string $field
  *
  * @return Zend_Db_Expr
  */
 protected function _getCategorySeoSuffixCaseSql($field)
 {
     /* @var $store Mage_Core_Model_Store */
     foreach ($this->_app->getStores() as $store) {
         $seoSuffix = $this->_categoryHelper->getCategoryUrlSuffix($store->getId());
         $casesResults[$store->getId()] = !empty($seoSuffix) ? '".' . $seoSuffix . '"' : '""';
     }
     return $this->_connection->getCaseSql($field, $casesResults);
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:16,代碼來源:Redirect.php

示例3: _prepareIndexSelect

 /**
  * Prepare index select
  *
  * @param Mage_Core_Model_Website $website
  * @param $time
  * @return Varien_Db_Select
  */
 protected function _prepareIndexSelect(Mage_Core_Model_Website $website, $time)
 {
     $nA = $this->_connection->quote('N/A');
     $this->_connection->query('SET @price := NULL');
     $this->_connection->query('SET @group_id := NULL');
     $this->_connection->query('SET @action_stop := NULL');
     $indexSelect = $this->_connection->select()->from(array('cppt' => $this->_getTemporaryTable()), array())->order(array('cppt.grouped_id', 'cppt.sort_order', 'cppt.rule_product_id'))->columns(array('customer_group_id' => 'cppt.customer_group_id', 'product_id' => 'cppt.product_id', 'rule_price' => $this->_calculatePrice(), 'latest_start_date' => 'cppt.from_date', 'earliest_end_date' => 'cppt.to_date', new Zend_Db_Expr($this->_connection->getCaseSql('', array($this->_connection->getIfNullSql(new Zend_Db_Expr('@group_id'), $nA) . ' != cppt.grouped_id' => new Zend_Db_Expr('@action_stop := cppt.action_stop'), $this->_connection->getIfNullSql(new Zend_Db_Expr('@group_id'), $nA) . ' = cppt.grouped_id' => '@action_stop := ' . $this->_connection->getIfNullSql(new Zend_Db_Expr('@action_stop'), new Zend_Db_Expr(0)) . ' + cppt.action_stop'))), new Zend_Db_Expr('@group_id := cppt.grouped_id'), 'from_time' => 'cppt.from_time', 'to_time' => 'cppt.to_time'));
     $select = $this->_connection->select()->from($indexSelect, array())->joinInner(array('dates' => $this->_connection->select()->union(array(new Zend_Db_Expr('SELECT ' . $this->_connection->getDateAddSql($this->_connection->fromUnixtime($time), -1, Varien_Db_Adapter_Interface::INTERVAL_DAY) . ' AS rule_date'), new Zend_Db_Expr('SELECT ' . $this->_connection->fromUnixtime($time) . ' AS rule_date'), new Zend_Db_Expr('SELECT ' . $this->_connection->getDateAddSql($this->_connection->fromUnixtime($time), 1, Varien_Db_Adapter_Interface::INTERVAL_DAY) . ' AS rule_date')))), '1=1', array())->columns(array('rule_product_price_id' => new Zend_Db_Expr('NULL'), 'rule_date' => 'dates.rule_date', 'customer_group_id' => 'customer_group_id', 'product_id' => 'product_id', 'rule_price' => 'MIN(rule_price)', 'website_id' => new Zend_Db_Expr($website->getId()), 'latest_start_date' => 'latest_start_date', 'earliest_end_date' => 'earliest_end_date'))->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " >= from_time"))->where($this->_connection->getCheckSql(new Zend_Db_Expr('to_time = 0'), new Zend_Db_Expr(1), new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " <= to_time")))->group(array('customer_group_id', 'product_id', 'dates.rule_date'));
     return $select;
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:17,代碼來源:Refresh.php


注:本文中的Varien_Db_Adapter_Interface::getCaseSql方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。