CoinFreightDeduction.php 545 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: blank
  5. * Date: 2022/4/13
  6. * Time: 17:53
  7. */
  8. namespace app\frontend\modules\dispatch\deduction;
  9. class CoinFreightDeduction extends BaseFreightDeduction
  10. {
  11. /**
  12. * 抵扣运费金额
  13. * @return int|mixed
  14. * @throws \app\common\exceptions\AppException
  15. */
  16. public function _getAmount()
  17. {
  18. if ($this->orderDeduction->openFreightDeduction()) {
  19. return max($this->orderDeduction->getUsableFreightDeduction()->getMoney(),0);
  20. }
  21. return 0;
  22. }
  23. }