[algospot-judge] r216 committed - SubmissionModel::GetCount works with state filter.

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 11, 2010, 3:27:59 AM7/11/10
to algospo...@googlegroups.com
Revision: 216
Author: jongman
Date: Sat Jul 10 22:18:17 2010
Log: SubmissionModel::GetCount works with state filter.
http://code.google.com/p/algospot-judge/source/detail?r=216

Modified:
/trunk/vanillaapp/controllers/class.problemscontroller.php
/trunk/vanillaapp/models/class.submissionmodel.php

=======================================
--- /trunk/vanillaapp/controllers/class.problemscontroller.php Sat Jul 10
22:18:10 2010
+++ /trunk/vanillaapp/controllers/class.problemscontroller.php Sat Jul 10
22:18:17 2010
@@ -328,7 +328,7 @@
if($_GET["State"] != $i)
array_push($ExcludeState, $i);
}
- $Count = $this->SubmissionModel->GetCount($Author, $ShowHidden);
+ $Count = $this->SubmissionModel->GetCount($Author, $ShowHidden,
$ExcludeState);
$Submissions = $this->SubmissionModel->GetList($Author,
$ShowHidden, $params["Limit"], $params["Offset"], $ExcludeState,
$params["OrderFields"], $params["OrderDirection"]);
$this->SetData("Count", $Count, TRUE);
$this->SetData("Submissions", $Submissions, TRUE);
=======================================
--- /trunk/vanillaapp/models/class.submissionmodel.php Sat Jul 10 22:18:04
2010
+++ /trunk/vanillaapp/models/class.submissionmodel.php Sat Jul 10 22:18:17
2010
@@ -102,12 +102,12 @@
return $ret;
}

- public function GetCount($Author, $ShowHidden) {
+ public function GetCount($Author, $ShowHidden, $ExcludeState=array()) {
$Session = Gdn::Session();
$UserID = $Session->IsValid() ? $Session->UserID : -1;

$this->SQL->Select("Count(No) as Cnt")->From("Submission s");
- $this->Where($Author, $ShowHidden, $UserID);
+ $this->Where($Author, $ShowHidden, $UserID, $ExcludeState);
$ret = $this->SQL->Get();
return $ret->FirstRow()->Cnt;
}

Reply all
Reply to author
Forward
0 new messages