* Refactor the ajaxGetReviewAmount.

This commit is contained in:
daitingting
2023-09-04 03:18:27 +00:00
parent 19de252d0a
commit 2ec807b54f
3 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ window.savaTestcaseReview = function()
if(needReview == 0)
{
$.ajaxSubmit({
url: $.createLink('testcase', 'ajaxGetReviewCount'),
url: $.createLink('testcase', 'ajaxGetReviewAmount'),
onComplete: function(count)
{
stopSubmit = true;
+4 -3
View File
@@ -1324,14 +1324,15 @@ class testcase extends control
}
/**
* Ajax: Get count of need review casese.
* 获取待审核的用例数。
* Ajax: Get amount of casees pending review.
*
* @access public
* @return int
*/
public function ajaxGetReviewCount()
public function ajaxGetReviewAmount()
{
echo $this->dao->select('count(id) as count')->from(TABLE_CASE)->where('status')->eq('wait')->fetch('count');
echo $this->testcaseTao->getReviewAmount();
}
/**
+11
View File
@@ -293,4 +293,15 @@ class testcaseTao extends testcaseModel
}
}
}
/**
* Get the amount of cases pending review.
*
* @access protected
* @return int
*/
protected function getReviewAmount(): int
{
return $this->dao->select('COUNT(id) AS count')->from(TABLE_CASE)->where('status')->eq('wait')->fetch('count');
}
}