* Adjust mr create logic

This commit is contained in:
zenggang
2021-11-26 08:12:46 +00:00
parent f451a1c23e
commit 6bfdcd4e40
5 changed files with 18 additions and 6 deletions
+4
View File
@@ -85,6 +85,9 @@ class mrModel extends model
public function create()
{
$MR = fixer::input('post')
->setDefault('jobID', 0)
->setDefault('repoID', 0)
->setDefault('needCI', 0)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->get();
@@ -103,6 +106,7 @@ class mrModel extends model
$this->dao->insert(TABLE_MR)->data($MR, $this->config->mr->create->skippedFields)
->batchCheck($this->config->mr->create->requiredFields, 'notempty')
->checkIF($MR->needCI, 'jobID', 'notempty')
->autoCheck()
->exec();
if(dao::isError()) return array('result' => 'fail', 'message' => dao::getError());