dog overview
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
@ -15,6 +15,39 @@ class Dog extends Model
|
||||
'active' => ['type' => 'bool', 'default' => 1]
|
||||
);
|
||||
|
||||
function getResults($dogid=false)
|
||||
{
|
||||
if(!$dogid)
|
||||
$dogid = $this->id;
|
||||
$res = new Result();
|
||||
$keys = $GLOBALS['redis']->keys($res->getTable() . ':*');
|
||||
$results = [];
|
||||
foreach ($keys as $key) {
|
||||
$id = end(explode(':', $key));
|
||||
$res = new Result();
|
||||
$res->load($id);
|
||||
if ($res->data['dog'] == $dogid) {
|
||||
$results[] = $res->data;
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
function getRuns()
|
||||
{
|
||||
$run = new Run();
|
||||
$keys = $GLOBALS['redis']->keys($run->dbTable . ':*');
|
||||
$runs = [];
|
||||
foreach ($keys as $key) {
|
||||
$id = end(explode(':', $key));
|
||||
$run = new Run();
|
||||
$run->load($id);
|
||||
if ($run->data['dog'] == $this->id)
|
||||
$runs[] = $run->data;
|
||||
}
|
||||
return $runs;
|
||||
}
|
||||
|
||||
function isMyDog($dog = false)
|
||||
{
|
||||
if ($dog == false)
|
||||
|
Reference in New Issue
Block a user