clqms-be/app/Models/ValueSet/ValueSetDefModel.php

31 lines
733 B
PHP
Raw Normal View History

2025-10-14 16:54:43 +07:00
<?php
namespace App\Models\ValueSet;
2025-10-15 13:40:21 +07:00
use App\Models\BaseModel;
2025-10-14 16:54:43 +07:00
2025-10-14 18:53:06 +07:00
class ValueSetDefModel extends BaseModel {
2025-10-14 16:54:43 +07:00
protected $table = 'valuesetdef';
protected $primaryKey = 'VSetID';
protected $allowedFields = ['SiteID', 'VSName', 'VSDesc', 'CreateDate', 'EndDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
2025-10-14 16:54:43 +07:00
public function getValueSetDefs($param = null) {
if ($param !== null) {
$rows = $this->like('VSName', $param, 'both')
->orlike('VSDesc', $param, 'both')
->findAll();
2025-10-14 16:54:43 +07:00
} else {
$rows = $this->findAll();
}
return $rows;
}
}