Merge branch '15.0.beta3' of http://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
holan20180123
2021-05-19 15:20:16 +08:00
+18 -1
View File
@@ -115,6 +115,23 @@ class custom extends control
{
$data = fixer::input('post')->get();
$this->loadModel('setting')->setItems("system.$module", $data);
if($data->reviewRules == 'halfpass')
{
$storyList = $this->dao->select('t1.*')->from(TABLE_STORYREVIEW)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t2.status')->in('change, draft')
->fetchGroup('story');
foreach($storyList as $storyID => $reviewerList)
{
$passCount = 0;
foreach($reviewerList as $reviewer) $passCount += $reviewer->result == 'pass' ? 1 : 0;
if($passCount >= floor(count($reviewerList) / 2) + 1)
{
$this->dao->update(TABLE_STORY)->set('status')->eq('active')->where('id')->eq($storyID)->exec();
}
}
}
}
elseif($module == 'testcase' and $field == 'review')
{
@@ -221,7 +238,7 @@ class custom extends control
$this->view->fieldList = $fieldList;
$this->view->dbFields = $dbFields;
$this->view->field = $field;
$this->view->lang2Set = str_replace('_', '-', $lang);
$this->view->lang2Set = str_replace('_', '-', $lang);
$this->view->module = $module;
$this->view->currentLang = $currentLang;
$this->view->canAdd = strpos($this->config->custom->canAdd[$module], $field) !== false;