29 lines
842 B
PHP
29 lines
842 B
PHP
<?php
|
|
|
|
namespace App\Helpers\Customer\Wallet;
|
|
|
|
use RuntimeException;
|
|
|
|
class PointHelper extends WalletHelper
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
|
{
|
|
switch ($field) {
|
|
case 'amount':
|
|
$value = number_format($value) . "점";
|
|
break;
|
|
default:
|
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
|
break;
|
|
}
|
|
if (is_array($value)) {
|
|
throw new RuntimeException(static::class . "->" . __FUNCTION__ . "에서 오류발생:{$field}에 해당하는 Return 값이 배열형식입니다.\n" . var_export($value, true));
|
|
}
|
|
return $value;
|
|
}
|
|
}
|