OrderDispatchPriceNode.php 554 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2019/1/23
  6. * Time: 11:36 AM
  7. */
  8. namespace app\frontend\modules\order;
  9. class OrderDispatchPriceNode extends OrderPriceNode
  10. {
  11. /**
  12. * @return string
  13. */
  14. public function getKey()
  15. {
  16. return 'orderDispatchPrice';
  17. }
  18. /**
  19. * @return int|mixed|number
  20. * @throws \app\common\exceptions\AppException
  21. */
  22. public function getPrice()
  23. {
  24. return max($this->order->getPriceBefore($this->getKey()) + $this->order->getDispatchAmount(),0);
  25. }
  26. }