示例#1
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $cnd = parent::getSearchCondition();
     $cnd->{\XLite\Model\Repo\Payment\Method::P_MODULE_ENABLED} = true;
     $cnd->{\XLite\Model\Repo\Payment\Method::P_ADDED} = true;
     $cnd->{\XLite\Model\Repo\Payment\Method::P_ORDERBY} = array('m.class, translations.name', 'asc');
     return $cnd;
 }
示例#2
0
文件: AProduct.php 项目: kingsj/core
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     // We initialize structure to define order (field and sort direction) in search query.
     $result->{\XLite\Model\Repo\Product::P_ORDER_BY} = $this->getOrderBy();
     return $result;
 }
示例#3
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $cnd = parent::getSearchCondition();
     if (static::SORT_OPT_NEWEST == $this->getSortBy()) {
         // Newest sorting is also sorted by module name
         $cnd->{\XLite\Model\Repo\Module::P_ORDER_BY} = array(array(static::SORT_OPT_NEWEST, $this->getSortOrder()), array(static::SORT_OPT_ALPHA, self::SORT_ORDER_ASC));
     } else {
         $cnd->{\XLite\Model\Repo\Module::P_ORDER_BY} = array($this->getSortBy(), $this->getSortOrder());
     }
     return $cnd;
 }
示例#4
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if (static::PARAM_SEARCH_ADDITION_DATE == $requestParam && is_array($paramValue)) {
             foreach ($paramValue as $i => $date) {
                 if (is_string($date) && false !== strtotime($date)) {
                     $paramValue[$i] = strtotime($date);
                 }
             }
         }
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_ORDERBY} = array('r.additionDate', 'DESC');
     $profile = \XLite\Core\Auth::getInstance()->getProfile() ?: null;
     $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_ZONE} = array(\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_ZONE_CUSTOMER, $profile);
     $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_PRODUCT} = $this->getProduct();
     $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_TYPE} = \XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_TYPE_REVIEWS_ONLY;
     return $result;
 }
示例#5
0
文件: AProfile.php 项目: kingsj/core
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Profile::SEARCH_ORDER_ID} = 0;
     return $result;
 }
示例#6
0
文件: AOrder.php 项目: kingsj/core
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Order::P_ORDER_BY} = array($this->getSortBy(), $this->getSortOrder());
     return $result;
 }