fix valuesetfld
This commit is contained in:
parent
8ff71a27fc
commit
ab0d6f0585
@ -100,14 +100,14 @@ class ValueSetField extends Controller {
|
||||
if (!$VSFldID) {
|
||||
return $this->failValidationErrors('VSFldID is required.');
|
||||
}
|
||||
$dataValueSetFld = $this->prepareData($input);
|
||||
$dataValueSetFld = $this->prepareDataValueSetFld($input);
|
||||
|
||||
if (!$this->validateData($data, $this->rulesValueSetFld)) {
|
||||
if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) {
|
||||
return $this->failValidationErrors( $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$this->db->transStart();
|
||||
$this->db->table('valuesetfld')->where('VSFldID', $VSFldID)->update($data);
|
||||
$this->db->table('valuesetfld')->where('VSFldID', $VSFldID)->update($dataValueSetFld);
|
||||
$this->db->transComplete();
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
@ -161,13 +161,15 @@ class ValueSetField extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
private function prepareData(array $input, string $now, string $mode = 'create'): array {
|
||||
private function prepareDataValueSetFld(array $input): array {
|
||||
$data = [
|
||||
"Vset" => $input['VSet'] ?? null,
|
||||
"VSet" => $input['VSet'] ?? null,
|
||||
"VSName" => $input['VSName'] ?? null,
|
||||
"VSDesc" => $input['VSDesc'] ?? null
|
||||
];
|
||||
|
||||
if(!empty($input["VSFldID"])) { $data["VSFldID"]=$input["VSFldID"]; }
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user