Skip to content

Commit

Permalink
Merge pull request EC-CUBE#12 from chihiro-adachi/fix-product-point
Browse files Browse the repository at this point in the history
商品ごとポイント付与率の修正
  • Loading branch information
chihiro-adachi committed May 2, 2016
2 parents 48888f9 + 3c69748 commit 3f88bec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Helper/PointCalculateHelper/PointCalculateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function getAddPointByProduct()
// 商品毎の付与率あればそちらを優先
// なければサイト設定ポイントを利用
$calculateRate = $basicPointRate;
if (!empty($pointRate)) {
if (!is_null($pointRate)) {
$calculateRate = $pointRate;
}

Expand All @@ -402,8 +402,8 @@ public function getAddPointByProduct()

// 返却値生成
$rate = array();
$rate['min'] = (integer)$this->getRoundValue($min_price * ((integer)$calculateRate / 100));
$rate['max'] = (integer)$this->getRoundValue($max_price * ((integer)$calculateRate / 100));
$rate['min'] = (integer)$this->getRoundValue($min_price * ($calculateRate / 100));
$rate['max'] = (integer)$this->getRoundValue($max_price * ($calculateRate / 100));

return $rate;
}
Expand Down
4 changes: 2 additions & 2 deletions Repository/PointProductRateRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function getPointProductRateByEntity($entity = null)
SELECT
MAX(t2.plg_point_product_rate_id)
FROM Plugin\Point\Entity\PointProductRate t2
WHERE t2.plg_point_product_rate IS NOT NULL AND t1.product_id = t1.product_id
)';
WHERE t1.product_id = t1.product_id
) AND t1.plg_point_product_rate IS NOT NULL';

$result = $this->getEntityManager()->createQuery($dql)->getArrayResult();

Expand Down
2 changes: 1 addition & 1 deletion Resource/doctrine/migration/Version20151215144009.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function up(Schema $schema)
$t = $schema->createTable(self::PLG_POINT_PRODUCT_RATE);
$t->addColumn('plg_point_product_rate_id', 'integer', array('NotNull' => true, 'autoincrement' => true));
$t->addColumn('product_id', 'integer', array('NotNull' => true, 'Default' => 0));
$t->addColumn('plg_point_product_rate', 'integer', array('NotNull' => false, 'Default' => 0));
$t->addColumn('plg_point_product_rate', 'integer', array('NotNull' => false));
$t->addColumn('create_date', 'datetime', array('NotNull' => true));
$t->addColumn('update_date', 'datetime', array('NotNull' => true));
$t->setPrimaryKey(array('plg_point_product_rate_id'));
Expand Down

0 comments on commit 3f88bec

Please sign in to comment.