* testcaseModel: fix error of batch review cases.

This commit is contained in:
liugang
2023-08-15 16:34:42 +08:00
parent d900eb39e9
commit ff81a854d9
+7 -6
View File
@@ -1063,14 +1063,10 @@ class testcaseModel extends model
*/
public function batchReview($caseIDList, $result)
{
$caseIDList = $this->filterIdList($caseIDList);
$caseIDList = array_filter($caseIDList);
if(!$caseIDList) return false;
$oldCases = $this->getByList($caseIDList, 'status = wait');
$this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('status')->eq('wait')->andWhere('id')->in($caseIDList)->exec();
if(dao::isError()) return false;
$this->loadModel('action');
$oldCases = $this->getByList($caseIDList, "status = 'wait'");
$now = helper::now();
$case = new stdClass();
@@ -1080,6 +1076,11 @@ class testcaseModel extends model
$case->lastEditedDate = $now;
if($result == 'pass') $case->status = 'normal';
$this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('status')->eq('wait')->andWhere('id')->in($caseIDList)->exec();
if(dao::isError()) return false;
$this->loadModel('action');
foreach($oldCases as $oldCase)
{
$changes = common::createChanges($oldCase, $case);