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; } }