49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Customer;
|
|
|
|
use App\Entities\Customer\ServiceEntity;
|
|
use tidy;
|
|
|
|
class ServiceModel extends CustomerModel
|
|
{
|
|
const TABLE = "serviceinfo";
|
|
const PK = "uid";
|
|
const TITLE = "title";
|
|
protected $table = self::TABLE;
|
|
// protected $useAutoIncrement = false;
|
|
protected $primaryKey = self::PK;
|
|
protected $returnType = ServiceEntity::class;
|
|
protected $allowedFields = [
|
|
"uid",
|
|
"user_uid",
|
|
"clientinfo_uid",
|
|
"serverinfo_uid",
|
|
"payment_uid",
|
|
"code",
|
|
"title",
|
|
"site",
|
|
"location",
|
|
"rack",
|
|
"line",
|
|
"billing_at",
|
|
"sale",
|
|
"amount",
|
|
"start_at",
|
|
"end_at",
|
|
"history",
|
|
"status",
|
|
"updated_at"
|
|
];
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
//입력전 코드처리
|
|
final public function create(array $formDatas): ServiceEntity
|
|
{
|
|
$formDatas['code'] = $formDatas['site'] . "_s" . uniqid();
|
|
return parent::create($formDatas);
|
|
}
|
|
}
|