* Refactor the ajaxGetReviewAmount.
This commit is contained in:
@@ -59,7 +59,7 @@ window.savaTestcaseReview = function()
|
||||
if(needReview == 0)
|
||||
{
|
||||
$.ajaxSubmit({
|
||||
url: $.createLink('testcase', 'ajaxGetReviewCount'),
|
||||
url: $.createLink('testcase', 'ajaxGetReviewAmount'),
|
||||
onComplete: function(count)
|
||||
{
|
||||
stopSubmit = true;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user