40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Customer;
|
|
|
|
use App\Models\Customer\ServiceItemModel;
|
|
|
|
class ServiceItemEntity extends CustomerEntity
|
|
{
|
|
const PK = ServiceItemModel::PK;
|
|
const TITLE = ServiceItemModel::TITLE;
|
|
public function getServiceUid(): int
|
|
{
|
|
return intval($this->attributes['serviceinfo_uid']);
|
|
}
|
|
public function getItemUid(): int
|
|
{
|
|
return intval($this->attributes['item_uid']);
|
|
}
|
|
public function getPrice(): int
|
|
{
|
|
return intval($this->attributes['price']);
|
|
}
|
|
public function getAmount(): int
|
|
{
|
|
return intval($this->attributes['amount']);
|
|
}
|
|
public function getView_Price(): string
|
|
{
|
|
return sprintf("원가:%s원 , 제공가:%s원", number_format($this->getPrice()), number_format($this->getAmount()));
|
|
}
|
|
public function getView_Sale(): string
|
|
{
|
|
return $this->getPrice() > $this->getAmount() ? "" : ICONS['SALE'];
|
|
}
|
|
public function getView_BillingCycle(): string
|
|
{
|
|
return $this->attributes['billing_cycle'] == "month" ? "" : ICONS['ONETIME'];;
|
|
}
|
|
}
|