Fixed visibility filter endpoint
This commit is contained in:
parent
2525b3c805
commit
8c884779bf
1 changed files with 4 additions and 4 deletions
|
@ -167,7 +167,10 @@ function getRecords($user_id, $limit = NULL, $finished = NULL, $visible = NULL)
|
|||
if ($visible != NULL) {
|
||||
$db->innerJoin("projects", "project_id");
|
||||
}
|
||||
$db->where("user_id", Comparison::EQUAL, $user_id);
|
||||
$db->where("ju_time_records.user_id", Comparison::EQUAL, $user_id);
|
||||
if ($visible != NULL) {
|
||||
$db->where("ju_projects.visible", Comparison::EQUAL, $visible);
|
||||
}
|
||||
if ($finished != NULL) {
|
||||
if ($finished) {
|
||||
$db->addSql(" AND end_time IS NOT NULL");
|
||||
|
@ -175,9 +178,6 @@ function getRecords($user_id, $limit = NULL, $finished = NULL, $visible = NULL)
|
|||
$db->addSql(" AND end_time IS NULL");
|
||||
}
|
||||
}
|
||||
if ($visible != NULL) {
|
||||
$db->where("visible", Comparison::EQUAL, $visible);
|
||||
}
|
||||
if ($limit != NULL) {
|
||||
$db->orderBy("record_id", Order::DESC);
|
||||
$db->limit($limit);
|
||||
|
|
Loading…
Reference in a new issue