* Add type hint and skipped fields before updating.

This commit is contained in:
dingguodong
2023-09-18 13:09:33 +08:00
parent f916cfbd7a
commit a9499e4d38
+4 -4
View File
@@ -831,7 +831,7 @@ class programModel extends model
* @access public
* @return array|false
*/
public function update(int $programID, object $program)
public function update(int $programID, object $program): array|false
{
$oldProgram = $this->fetchByID($programID);
@@ -847,9 +847,9 @@ class programModel extends model
if(isset($this->lang->program->$field)) $this->lang->project->$field = $this->lang->program->$field;
}
$this->dao->update(TABLE_PROGRAM)->data($program)
->autoCheck($skipFields = 'begin,end')
->batchcheck($this->config->program->edit->requiredFields, 'notempty')
$this->dao->update(TABLE_PROGRAM)->data($program, 'syncPRJUnit,exchangeRate')
->autoCheck('begin,end')
->batchCheck($this->config->program->edit->requiredFields, 'notempty')
->checkIF($program->begin != '', 'begin', 'date')
->checkIF($program->end != '', 'end', 'date')
->checkIF($program->end != '', 'end', 'gt', $program->begin)