From f157a35f20581491eaef90464bf2dce262408db5 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Wed, 21 Jul 2021 13:57:30 +0800 Subject: [PATCH] * Add params of list. --- api/v1/entries/bug.php | 2 +- api/v1/entries/products.php | 2 +- api/v1/entries/projects.php | 1 + api/v1/entries/users.php | 2 +- framework/api/entry.class.php | 3 +++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/v1/entries/bug.php b/api/v1/entries/bug.php index fb4b676b6b..4b44f4cef8 100644 --- a/api/v1/entries/bug.php +++ b/api/v1/entries/bug.php @@ -15,7 +15,7 @@ class bugEntry extends entry $data = $this->getData(); $bug = $data->data->bug; - $this->send(200, $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time')); + $this->send(200, $this->format($bug, 'deleted:bool,activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time')); } public function put($bugID) diff --git a/api/v1/entries/products.php b/api/v1/entries/products.php index bbfc563586..59c3cc71b8 100644 --- a/api/v1/entries/products.php +++ b/api/v1/entries/products.php @@ -11,7 +11,7 @@ class productsEntry extends entry public function get() { $control = $this->loadController('product', 'all'); - $control->all(); + $control->all($this->param('status', 'all'), $this->param('order', 'order_asc')); /* Response */ $data = $this->getData(); diff --git a/api/v1/entries/projects.php b/api/v1/entries/projects.php index 9bf4cdce21..f8d69bbaf5 100644 --- a/api/v1/entries/projects.php +++ b/api/v1/entries/projects.php @@ -24,6 +24,7 @@ class projectsEntry extends entry } return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'projects' => $result)); } + if(isset($data->status) and $data->status == 'fail') { return $this->sendError(400, $data->message); diff --git a/api/v1/entries/users.php b/api/v1/entries/users.php index e87c9539a5..9f3c26bdb1 100644 --- a/api/v1/entries/users.php +++ b/api/v1/entries/users.php @@ -11,7 +11,7 @@ class usersEntry extends entry public function get() { $control = $this->loadController('company', 'browse'); - $control->browse(); + $control->browse('inside', 0, $this->param('type', 'bydept'), $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 20), $this->param('page', 1)); $data = $this->getData(); if(isset($data->status) and $data->status == 'success') diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index fbd16704a2..70a4ea7a3f 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -476,6 +476,9 @@ class baseEntry return gmdate("Y-m-d\TH:i:s\Z", strtotime($value)); } return $value; + case 'int': + case 'bool': + return $value; default: return $value; }