当前位置: 首页>>代码示例>>PHP>>正文


PHP SpecificPrice::_getScoreQuery方法代码示例

本文整理汇总了PHP中SpecificPrice::_getScoreQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecificPrice::_getScoreQuery方法的具体用法?PHP SpecificPrice::_getScoreQuery怎么用?PHP SpecificPrice::_getScoreQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SpecificPrice的用法示例。


在下文中一共展示了SpecificPrice::_getScoreQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getQuantityDiscounts

    public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_product_attribute = null, $all_combinations = false, $id_customer = 0)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $now = date('Y-m-d H:i:s');
        $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT *,
					' . SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer) . '
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE
					`id_product` IN(0, ' . (int) $id_product . ') AND
					' . (!$all_combinations ? '`id_product_attribute` IN(0, ' . (int) $id_product_attribute . ') AND ' : '') . '
					`id_shop` IN(0, ' . (int) $id_shop . ') AND
					`id_currency` IN(0, ' . (int) $id_currency . ') AND
					`id_country` IN(0, ' . (int) $id_country . ') AND
					`id_group` IN(0, ' . (int) $id_group . ') AND
					`id_customer` IN(0, ' . (int) $id_customer . ')
					AND
					(
						(`from` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' >= `from`)
						AND
						(`to` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' <= `to`)
					)
					ORDER BY `from_quantity` ASC, `id_specific_price_rule` ASC, `score` DESC
		');
        $targeted_prices = array();
        $last_quantity = array();
        foreach ($res as $specific_price) {
            if (!isset($last_quantity[(int) $specific_price['id_product_attribute']])) {
                $last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
            } elseif ($last_quantity[(int) $specific_price['id_product_attribute']] == $specific_price['from_quantity']) {
                continue;
            }
            $last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
            if ($specific_price['from_quantity'] > PP::getSpecificPriceFromQty((int) $id_product)) {
                $targeted_prices[] = $specific_price;
            }
        }
        return $targeted_prices;
    }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:41,代码来源:SpecificPrice.php

示例2: getQuantityDiscount

    public static function getQuantityDiscount($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $now = date('Y-m-d H:i:s');
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
			SELECT *,
					' . SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer) . '
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE
					`id_product` IN(0, ' . (int) $id_product . ') AND
					`id_product_attribute` IN(0, ' . (int) $id_product_attribute . ') AND
					`id_shop` IN(0, ' . (int) $id_shop . ') AND
					`id_currency` IN(0, ' . (int) $id_currency . ') AND
					`id_country` IN(0, ' . (int) $id_country . ') AND
					`id_group` IN(0, ' . (int) $id_group . ') AND
					`id_customer` IN(0, ' . (int) $id_customer . ') AND
					`from_quantity` >= ' . (int) $quantity . '
					AND
					(
						(`from` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' >= `from`)
						AND
						(`to` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' <= `to`)
					)
					ORDER BY `from_quantity` DESC, `score` DESC
		');
    }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:28,代码来源:SpecificPrice.php

示例3: getQuantityDiscount

    public static function getQuantityDiscount($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $query_extra = self::computeExtraConditions($id_product, $id_product_attribute, $id_customer, null);
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
			SELECT *,
					' . SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer) . '
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE
					`id_shop` ' . self::formatIntInQuery(0, $id_shop) . ' AND
					`id_currency` ' . self::formatIntInQuery(0, $id_currency) . ' AND
					`id_country` ' . self::formatIntInQuery(0, $id_country) . ' AND
					`id_group` ' . self::formatIntInQuery(0, $id_group) . ' AND
					`from_quantity` >= ' . (int) $quantity . ' ' . $query_extra . '
					ORDER BY `from_quantity` DESC, `score` DESC, `to` DESC, `from` DESC
		');
    }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:19,代码来源:SpecificPrice.php


注:本文中的SpecificPrice::_getScoreQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。