adding method to fetch all active worker count
This commit is contained in:
parent
ece3d8fd25
commit
d352adf6f6
@ -57,6 +57,20 @@ class Worker {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getCountAllActiveWorkers() {
|
||||
$stmt = $this->mysqli->prepare("SELECT count(id) AS total FROM $this->table WHERE active = 1");
|
||||
if ($this->checkStmt($stmt)) {
|
||||
if (!$stmt->execute()) {
|
||||
return false;
|
||||
}
|
||||
$result = $stmt->get_result();
|
||||
$stmt->close();
|
||||
return $result->fetch_object()->total;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addWorker($account_id, $workerName, $workerPassword) {
|
||||
$username = $this->user->getUserName($account_id);
|
||||
$workerName = "$username.$workerName";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user