preOrderGoodsDeduction = $preOrderGoodsDeduction; parent::__construct($orderGoodsPrice, $weight); } function getKey() { return $this->preOrderGoodsDeduction->code.'Deduction'; } /** * @return float|int|mixed * @throws \app\common\exceptions\AppException */ function getPrice() { return $this->orderGoodsPrice->getPriceBefore($this->getKey()) - $this->preOrderGoodsDeduction->used_amount; } }