| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2020/9/3
- * Time: 15:28
- */
- namespace app\frontend\modules\orderGoods\price\adapter;
- class GoodsPriceAdapter extends BaseGoodsPriceAdapter
- {
- public function getPrice()
- {
- return $this->goods()->price;
- }
- public function getMarketPrice()
- {
- return $this->goods()->market_price;
- }
- public function getCostPrice()
- {
- return $this->goods()->cost_price;
- }
- protected function getDefaultDealPrice()
- {
- $level_discount_set = \Setting::get('discount.all_set');
- switch ($level_discount_set['type']) {
- case 1:
- $deal_price = $this->getMarketPrice();
- break;
- default:
- $deal_price = $this->getPrice();
- }
- return $deal_price;
- }
- protected function _getDealPrice()
- {
- return $this->goods()->deal_price;
- }
- protected function goods()
- {
- return $this->goods;
- }
- }
|