OrderGoodsPrice.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\frontend\modules\orderGoods\price\option;
  3. use app\frontend\modules\orderGoods\discount\EnoughReduce;
  4. use app\frontend\modules\orderGoods\discount\SingleEnoughReduce;
  5. use app\frontend\modules\orderGoods\models\PreOrderGoods;
  6. /**
  7. * Created by PhpStorm.
  8. * User: shenyang
  9. * Date: 2017/5/19
  10. * Time: 下午6:05
  11. */
  12. abstract class OrderGoodsPrice
  13. {
  14. /**
  15. * 需要重新计算
  16. * @var bool
  17. */
  18. protected $needCalculation = true;
  19. protected $goodsPrice;
  20. /**
  21. * @var \app\frontend\modules\orderGoods\models\PreOrderGoods
  22. */
  23. public $orderGoods;
  24. public function __construct($preOrderGoods)
  25. {
  26. $this->orderGoods = $preOrderGoods;
  27. }
  28. /**
  29. * 计算成交价格
  30. * @return float
  31. */
  32. abstract public function getPrice();
  33. /**
  34. * 计算商品销售价格
  35. * @return float
  36. */
  37. abstract public function getGoodsPrice();
  38. /**
  39. * 计算商品市场价格
  40. * @return float
  41. */
  42. abstract public function getGoodsMarketPrice();
  43. /**
  44. * 计算商品市场价格
  45. * @return float
  46. */
  47. abstract public function getGoodsCostPrice();
  48. }