PointShopDeductionSetting.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2017/10/13
  6. * Time: 下午1:49
  7. */
  8. namespace app\frontend\modules\finance\deduction\deductionSettings;
  9. use app\framework\Support\Facades\Log;
  10. use app\frontend\modules\deduction\DeductionSettingInterface;
  11. class PointShopDeductionSetting implements DeductionSettingInterface
  12. {
  13. public function getWeight()
  14. {
  15. return 30;
  16. }
  17. // todo 将运费抵扣分离出去
  18. public function isEnableDeductDispatchPrice()
  19. {
  20. Log::debug("监听抵扣状态", \Setting::get('point.set.point_freight'));
  21. return \Setting::get('point.set.point_freight');
  22. }
  23. public function isMaxDisable()
  24. {
  25. return !\Setting::get('point.set.point_deduct');
  26. }
  27. public function isMinDisable()
  28. {
  29. return !\Setting::get('point.set.point_deduct');
  30. }
  31. public function isDispatchDisable()
  32. {
  33. return !\Setting::get('point.set.point_deduct');
  34. }
  35. public function getMaxFixedAmount()
  36. {
  37. return false;
  38. }
  39. public function getMaxPriceProportion()
  40. {
  41. return \Setting::get('point.set.money_max');
  42. }
  43. public function getDeductionAmountType()
  44. {
  45. return \Setting::get('point.set.deduction_amount_type', 0);
  46. }
  47. public function getMinDeductionType()
  48. {
  49. return 'GoodsPriceProportion';
  50. }
  51. public function getMinFixedAmount()
  52. {
  53. return false;
  54. }
  55. public function getMinPriceProportion()
  56. {
  57. return \Setting::get('point.set.money_min');
  58. }
  59. public function getMaxDeductionType()
  60. {
  61. return 'GoodsPriceProportion';
  62. }
  63. public function getAffectDeductionAmount()
  64. {
  65. if (\Setting::get('point.set.point_deduction_integer')) {
  66. return 'integer';
  67. }
  68. return false;
  69. }
  70. }