admin/app/frontend/modules/finance/deduction/deductionSettings/PointShopDeductionSetting.php

86 lines
1.8 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: shenyang
* Date: 2017/10/13
* Time: 下午1:49
*/
namespace app\frontend\modules\finance\deduction\deductionSettings;
use app\framework\Support\Facades\Log;
use app\frontend\modules\deduction\DeductionSettingInterface;
class PointShopDeductionSetting implements DeductionSettingInterface
{
public function getWeight()
{
return 30;
}
// todo 将运费抵扣分离出去
public function isEnableDeductDispatchPrice()
{
Log::debug("监听抵扣状态", \Setting::get('point.set.point_freight'));
return \Setting::get('point.set.point_freight');
}
public function isMaxDisable()
{
return !\Setting::get('point.set.point_deduct');
}
public function isMinDisable()
{
return !\Setting::get('point.set.point_deduct');
}
public function isDispatchDisable()
{
return !\Setting::get('point.set.point_deduct');
}
public function getMaxFixedAmount()
{
return false;
}
public function getMaxPriceProportion()
{
return \Setting::get('point.set.money_max');
}
public function getDeductionAmountType()
{
return \Setting::get('point.set.deduction_amount_type', 0);
}
public function getMinDeductionType()
{
return 'GoodsPriceProportion';
}
public function getMinFixedAmount()
{
return false;
}
public function getMinPriceProportion()
{
return \Setting::get('point.set.money_min');
}
public function getMaxDeductionType()
{
return 'GoodsPriceProportion';
}
public function getAffectDeductionAmount()
{
if (\Setting::get('point.set.point_deduction_integer')) {
return 'integer';
}
return false;
}
}